particular string. A GQuark value of zero is associated to %NULL.</doc>
<type name="guint32" c:type="guint32"/>
</alias>
+ <alias name="RefString" c:type="GRefString">
+ <type name="gchar" c:type="char"/>
+ </alias>
<alias name="Strv" c:type="GStrv">
<doc xml:space="preserve">A typedef alias for gchar**. This is mostly useful when used together with
g_auto().</doc>
</parameters>
</function>
<function name="insert_vals" c:identifier="g_array_insert_vals" introspectable="0">
- <doc xml:space="preserve">Inserts @len elements into a #GArray at the given index.</doc>
+ <doc xml:space="preserve">Inserts @len elements into a #GArray at the given index.
+
+If @index_ is greater than the array’s current length, the array is expanded.
+The elements between the old end of the array and the newly inserted elements
+will be initialised to zero if the array was configured to clear elements;
+otherwise their values will be undefined.
+
+@data may be %NULL if (and only if) @len is zero. If @len is zero, this
+function is a no-op.</doc>
<return-value>
<doc xml:space="preserve">the #GArray</doc>
<array name="GLib.Array" c:type="GArray*">
<doc xml:space="preserve">the index to place the elements at</doc>
<type name="guint" c:type="guint"/>
</parameter>
- <parameter name="data" transfer-ownership="none">
+ <parameter name="data" transfer-ownership="none" nullable="1" allow-none="1">
<doc xml:space="preserve">a pointer to the elements to insert</doc>
<type name="gpointer" c:type="gconstpointer"/>
</parameter>
<function name="prepend_vals" c:identifier="g_array_prepend_vals" introspectable="0">
<doc xml:space="preserve">Adds @len elements onto the start of the array.
+@data may be %NULL if (and only if) @len is zero. If @len is zero, this
+function is a no-op.
+
This operation is slower than g_array_append_vals() since the
existing elements in the array have to be moved to make space for
the new elements.</doc>
<type name="gpointer" c:type="gpointer"/>
</array>
</parameter>
- <parameter name="data" transfer-ownership="none">
+ <parameter name="data" transfer-ownership="none" nullable="1" allow-none="1">
<doc xml:space="preserve">a pointer to the elements to prepend to the start of the array</doc>
<type name="gpointer" c:type="gconstpointer"/>
</parameter>
<parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the number of elements to prepend</doc>
+ <doc xml:space="preserve">the number of elements to prepend, which may be zero</doc>
<type name="guint" c:type="guint"/>
</parameter>
</parameters>
</parameters>
</method>
<method name="get_app_info" c:identifier="g_bookmark_file_get_app_info" version="2.12" throws="1">
- <doc xml:space="preserve">Gets the registration informations of @app_name for the bookmark for
-@uri. See g_bookmark_file_set_app_info() for more informations about
+ <doc xml:space="preserve">Gets the registration information of @app_name for the bookmark for
+@uri. See g_bookmark_file_set_app_info() for more information about
the returned data.
The string returned in @app_exec must be freed.
<parameter name="data" transfer-ownership="none">
<doc xml:space="preserve">desktop bookmarks
loaded in memory</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
+ <array length="1" zero-terminated="0" c:type="const gchar*">
<type name="guint8"/>
</array>
</parameter>
<doc xml:space="preserve">This function looks for a desktop bookmark file named @file in the
paths returned from g_get_user_data_dir() and g_get_system_data_dirs(),
loads the file into @bookmark and returns the file's full path in
-@full_path. If the file could not be loaded then an %error is
+@full_path. If the file could not be loaded then @error is
set to either a #GFileError or #GBookmarkFileError.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE if a key file could be loaded, %FALSE otherwise</doc>
<parameter name="groups" transfer-ownership="none" nullable="1" allow-none="1">
<doc xml:space="preserve">an array of
group names, or %NULL to remove all groups</doc>
- <array length="2" zero-terminated="0" c:type="gchar**">
+ <array length="2" zero-terminated="0" c:type="const gchar**">
<type name="utf8"/>
</array>
</parameter>
<method name="compare" c:identifier="g_bytes_compare" version="2.32">
<doc xml:space="preserve">Compares the two #GBytes values.
-This function can be used to sort GBytes instances in lexographical order.</doc>
+This function can be used to sort GBytes instances in lexicographical order.
+
+If @bytes1 and @bytes2 have different length but the shorter one is a
+prefix of the longer one then the shorter one is considered to be less than
+the longer one. Otherwise the first byte where both differ is used for
+comparison. If @bytes1 has a smaller value at that position it is
+considered less, otherwise greater than @bytes2.</doc>
<return-value transfer-ownership="none">
- <doc xml:space="preserve">a negative value if bytes2 is lesser, a positive value if bytes2 is
- greater, and zero if bytes2 is equal to bytes1</doc>
+ <doc xml:space="preserve">a negative value if @bytes1 is less than @bytes2, a positive value
+ if @bytes1 is greater than @bytes2, and zero if @bytes1 is equal to
+ @bytes2</doc>
<type name="gint" c:type="gint"/>
</return-value>
<parameters>
</instance-parameter>
<parameter name="buffer" transfer-ownership="none">
<doc xml:space="preserve">output buffer</doc>
- <type name="guint8" c:type="guint8*"/>
+ <array length="1" zero-terminated="0" c:type="guint8*">
+ <type name="guint8" c:type="guint8"/>
+ </array>
</parameter>
- <parameter name="digest_len" transfer-ownership="none">
+ <parameter name="digest_len" direction="inout" caller-allocates="0" transfer-ownership="full">
<doc xml:space="preserve">an inout parameter. The caller initializes it to the size of @buffer.
After the call it contains the length of the digest.</doc>
<type name="gsize" c:type="gsize*"/>
</instance-parameter>
<parameter name="data" transfer-ownership="none">
<doc xml:space="preserve">buffer used to compute the checksum</doc>
- <array length="1" zero-terminated="0" c:type="guchar*">
+ <array length="1" zero-terminated="0" c:type="const guchar*">
<type name="guint8"/>
</array>
</parameter>
To set the value of a date to the current day, you could write:
|[<!-- language="C" -->
- g_date_set_time_t (date, time (NULL));
+ time_t now = time (NULL);
+ if (now == (time_t) -1)
+ // handle the error
+ g_date_set_time_t (date, now);
]|</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</instance-parameter>
</parameters>
</method>
+ <method name="get_timezone" c:identifier="g_date_time_get_timezone" version="2.58">
+ <doc xml:space="preserve">Get the time zone for this @datetime.</doc>
+ <return-value transfer-ownership="none">
+ <doc xml:space="preserve">the time zone</doc>
+ <type name="TimeZone" c:type="GTimeZone*"/>
+ </return-value>
+ <parameters>
+ <instance-parameter name="datetime" transfer-ownership="none">
+ <doc xml:space="preserve">a #GDateTime</doc>
+ <type name="DateTime" c:type="GDateTime*"/>
+ </instance-parameter>
+ </parameters>
+ </method>
<method name="get_timezone_abbreviation" c:identifier="g_date_time_get_timezone_abbreviation" version="2.26">
<doc xml:space="preserve">Determines the time zone abbreviation to be used at the time and in
the time zone of @datetime.
</parameter>
</parameters>
</function>
+ <function name="steal_extended" c:identifier="g_hash_table_steal_extended" version="2.58">
+ <doc xml:space="preserve">Looks up a key in the #GHashTable, stealing the original key and the
+associated value and returning %TRUE if the key was found. If the key was
+not found, %FALSE is returned.
+
+If found, the stolen key and value are removed from the hash table without
+calling the key and value destroy functions, and ownership is transferred to
+the caller of this method; as with g_hash_table_steal().
+
+You can pass %NULL for @lookup_key, provided the hash and equal functions
+of @hash_table are %NULL-safe.</doc>
+ <return-value transfer-ownership="none">
+ <doc xml:space="preserve">%TRUE if the key was found in the #GHashTable</doc>
+ <type name="gboolean" c:type="gboolean"/>
+ </return-value>
+ <parameters>
+ <parameter name="hash_table" transfer-ownership="none">
+ <doc xml:space="preserve">a #GHashTable</doc>
+ <type name="GLib.HashTable" c:type="GHashTable*">
+ <type name="gpointer" c:type="gpointer"/>
+ <type name="gpointer" c:type="gpointer"/>
+ </type>
+ </parameter>
+ <parameter name="lookup_key" transfer-ownership="none" nullable="1" allow-none="1">
+ <doc xml:space="preserve">the key to look up</doc>
+ <type name="gpointer" c:type="gconstpointer"/>
+ </parameter>
+ <parameter name="stolen_key" direction="out" caller-allocates="0" transfer-ownership="full" nullable="1" optional="1" allow-none="1">
+ <doc xml:space="preserve">return location for the
+ original key</doc>
+ <type name="gpointer" c:type="gpointer*"/>
+ </parameter>
+ <parameter name="stolen_value" direction="out" caller-allocates="0" transfer-ownership="full" nullable="1" optional="1" allow-none="1">
+ <doc xml:space="preserve">return location
+ for the value associated with the key</doc>
+ <type name="gpointer" c:type="gpointer*"/>
+ </parameter>
+ </parameters>
+ </function>
<function name="unref" c:identifier="g_hash_table_unref" version="2.10">
<doc xml:space="preserve">Atomically decrements the reference count of @hash_table by one.
If the reference count drops to 0, all keys and values will be
</instance-parameter>
<parameter name="buffer" transfer-ownership="none">
<doc xml:space="preserve">output buffer</doc>
- <type name="guint8" c:type="guint8*"/>
+ <array length="1" zero-terminated="0" c:type="guint8*">
+ <type name="guint8" c:type="guint8"/>
+ </array>
</parameter>
- <parameter name="digest_len" transfer-ownership="none">
+ <parameter name="digest_len" direction="inout" caller-allocates="0" transfer-ownership="full">
<doc xml:space="preserve">an inout parameter. The caller initializes it to the
size of @buffer. After the call it contains the length of the digest</doc>
<type name="gsize" c:type="gsize*"/>
</instance-parameter>
<parameter name="data" transfer-ownership="none">
<doc xml:space="preserve">buffer used to compute the checksum</doc>
- <array length="1" zero-terminated="0" c:type="guchar*">
+ <array length="1" zero-terminated="0" c:type="const guchar*">
<type name="guint8" c:type="guchar"/>
</array>
</parameter>
</parameter>
<parameter name="key" transfer-ownership="none">
<doc xml:space="preserve">the key for the HMAC</doc>
- <array length="2" zero-terminated="0" c:type="guchar*">
+ <array length="2" zero-terminated="0" c:type="const guchar*">
<type name="guint8" c:type="guchar"/>
</array>
</parameter>
</instance-parameter>
<parameter name="buf" transfer-ownership="none">
<doc xml:space="preserve">a buffer to write data from</doc>
- <array zero-terminated="0" c:type="gchar*">
+ <array zero-terminated="0" c:type="const gchar*">
<type name="guint8"/>
</array>
</parameter>
</parameter>
<parameter name="search_dirs" transfer-ownership="none">
<doc xml:space="preserve">%NULL-terminated array of directories to search</doc>
- <array c:type="gchar**">
+ <array c:type="const gchar**">
<type name="filename"/>
</array>
</parameter>
<parameter name="list" transfer-ownership="none">
<doc xml:space="preserve">a %NULL-terminated array of locale string values</doc>
<array length="4" zero-terminated="1" c:type="const gchar* const*">
- <type name="utf8" c:type="gchar"/>
+ <type name="utf8" c:type="gchar*"/>
</array>
</parameter>
<parameter name="length" transfer-ownership="none">
container itself.
@func, as a #GCopyFunc, takes two arguments, the data to be copied
-and a @user_data pointer. It's safe to pass %NULL as user_data,
-if the copy function takes only one argument.
+and a @user_data pointer. On common processor architectures, it's safe to
+pass %NULL as @user_data if the copy function takes only one argument. You
+may get compiler warnings from this though if compiling with GCC’s
+`-Wcast-function-type` warning.
For instance, if @list holds a list of GObjects, you can do:
|[<!-- language="C" -->
</parameter>
<parameter name="fields" transfer-ownership="none">
<doc xml:space="preserve">fields forming the message</doc>
- <array length="2" zero-terminated="0" c:type="GLogField*">
+ <array length="2" zero-terminated="0" c:type="const GLogField*">
<type name="LogField" c:type="GLogField"/>
</array>
</parameter>
<doc xml:space="preserve">The minimum value which can be held in a #gint8.</doc>
<type name="gint8" c:type="gint8"/>
</constant>
- <constant name="MINOR_VERSION" value="56" c:type="GLIB_MINOR_VERSION">
+ <constant name="MINOR_VERSION" value="58" c:type="GLIB_MINOR_VERSION">
<doc xml:space="preserve">The minor version number of the GLib library.
Like #gtk_minor_version, but from the headers used at
</instance-parameter>
</parameters>
</method>
- <method name="wait" c:identifier="g_main_context_wait">
+ <method name="wait" c:identifier="g_main_context_wait" deprecated="1" deprecated-version="2.58">
<doc xml:space="preserve">Tries to become the owner of the specified context,
as with g_main_context_acquire(). But if another thread
is the owner, atomically drop @mutex and wait on @cond until
that owner releases ownership or until @cond is signaled, then
try again (once) to become the owner.</doc>
+ <doc-deprecated xml:space="preserve">Use g_main_context_is_owner() and separate locking instead.</doc-deprecated>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE if the operation succeeded, and
this thread is now the owner of @context.</doc>
<method name="ref" c:identifier="g_option_group_ref" version="2.44">
<doc xml:space="preserve">Increments the reference count of @group by one.</doc>
<return-value transfer-ownership="full">
- <doc xml:space="preserve">a #GoptionGroup</doc>
+ <doc xml:space="preserve">a #GOptionGroup</doc>
<type name="OptionGroup" c:type="GOptionGroup*"/>
</return-value>
<parameters>
<doc xml:space="preserve">Removes the pointer at the given index from the pointer array.
The following elements are moved down one place. If @array has
a non-%NULL #GDestroyNotify function it is called for the removed
-element.</doc>
+element. If so, the return value from this function will potentially point
+to freed memory (depending on the #GDestroyNotify implementation).</doc>
<return-value transfer-ownership="none" nullable="1">
<doc xml:space="preserve">the pointer which was removed</doc>
<type name="gpointer" c:type="gpointer"/>
The last element in the array is used to fill in the space, so
this function does not preserve the order of the array. But it
is faster than g_ptr_array_remove_index(). If @array has a non-%NULL
-#GDestroyNotify function it is called for the removed element.</doc>
+#GDestroyNotify function it is called for the removed element. If so, the
+return value from this function will potentially point to freed memory
+(depending on the #GDestroyNotify implementation).</doc>
<return-value transfer-ownership="none" nullable="1">
<doc xml:space="preserve">the pointer which was removed</doc>
<type name="gpointer" c:type="gpointer"/>
</parameter>
</parameters>
</function>
+ <function name="steal_index" c:identifier="g_ptr_array_steal_index" version="2.58" introspectable="0">
+ <doc xml:space="preserve">Removes the pointer at the given index from the pointer array.
+The following elements are moved down one place. The #GDestroyNotify for
+@array is *not* called on the removed element; ownership is transferred to
+the caller of this function.</doc>
+ <return-value transfer-ownership="full" nullable="1">
+ <doc xml:space="preserve">the pointer which was removed</doc>
+ <type name="gpointer" c:type="gpointer"/>
+ </return-value>
+ <parameters>
+ <parameter name="array" transfer-ownership="none">
+ <doc xml:space="preserve">a #GPtrArray</doc>
+ <array name="GLib.PtrArray" c:type="GPtrArray*">
+ <type name="gpointer" c:type="gpointer"/>
+ </array>
+ </parameter>
+ <parameter name="index_" transfer-ownership="none">
+ <doc xml:space="preserve">the index of the pointer to steal</doc>
+ <type name="guint" c:type="guint"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="steal_index_fast" c:identifier="g_ptr_array_steal_index_fast" version="2.58" introspectable="0">
+ <doc xml:space="preserve">Removes the pointer at the given index from the pointer array.
+The last element in the array is used to fill in the space, so
+this function does not preserve the order of the array. But it
+is faster than g_ptr_array_steal_index(). The #GDestroyNotify for @array is
+*not* called on the removed element; ownership is transferred to the caller
+of this function.</doc>
+ <return-value transfer-ownership="full" nullable="1">
+ <doc xml:space="preserve">the pointer which was removed</doc>
+ <type name="gpointer" c:type="gpointer"/>
+ </return-value>
+ <parameters>
+ <parameter name="array" transfer-ownership="none">
+ <doc xml:space="preserve">a #GPtrArray</doc>
+ <array name="GLib.PtrArray" c:type="GPtrArray*">
+ <type name="gpointer" c:type="gpointer"/>
+ </array>
+ </parameter>
+ <parameter name="index_" transfer-ownership="none">
+ <doc xml:space="preserve">the index of the pointer to steal</doc>
+ <type name="guint" c:type="guint"/>
+ </parameter>
+ </parameters>
+ </function>
<function name="unref" c:identifier="g_ptr_array_unref" version="2.22" introspectable="0">
<doc xml:space="preserve">Atomically decrements the reference count of @array by one. If the
reference count drops to 0, the effect is the same as calling
</parameters>
</method>
<method name="match" c:identifier="g_regex_match" version="2.14">
- <doc xml:space="preserve">Scans for a match in string for the pattern in @regex.
+ <doc xml:space="preserve">Scans for a match in @string for the pattern in @regex.
The @match_options are combined with the match options specified
when the @regex structure was created, letting you have more
flexibility in reusing #GRegex structures.
+Unless %G_REGEX_RAW is specified in the options, @string must be valid UTF-8.
+
A #GMatchInfo structure, used to get information on the match,
is stored in @match_info if not %NULL. Note that if @match_info
is not %NULL then it is created even if the function returns %FALSE,
</method>
<method name="match_all_full" c:identifier="g_regex_match_all_full" version="2.14" throws="1">
<doc xml:space="preserve">Using the standard algorithm for regular expression matching only
-the longest match in the string is retrieved, it is not possible
+the longest match in the @string is retrieved, it is not possible
to obtain all the available matches. For instance matching
"<a> <b> <c>" against the pattern "<.*>"
you get "<a> <b> <c>".
string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern
that begins with any kind of lookbehind assertion, such as "\b".
+Unless %G_REGEX_RAW is specified in the options, @string must be valid UTF-8.
+
A #GMatchInfo structure, used to get information on the match, is
stored in @match_info if not %NULL. Note that if @match_info is
not %NULL then it is created even if the function returns %FALSE,
</instance-parameter>
<parameter name="string" transfer-ownership="none">
<doc xml:space="preserve">the string to scan for matches</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
+ <array length="1" zero-terminated="0" c:type="const gchar*">
<type name="utf8" c:type="gchar"/>
</array>
</parameter>
<parameter name="string_len" transfer-ownership="none">
- <doc xml:space="preserve">the length of @string, or -1 if @string is nul-terminated</doc>
+ <doc xml:space="preserve">the length of @string, in bytes, or -1 if @string is nul-terminated</doc>
<type name="gssize" c:type="gssize"/>
</parameter>
<parameter name="start_position" transfer-ownership="none">
</parameters>
</method>
<method name="match_full" c:identifier="g_regex_match_full" version="2.14" throws="1">
- <doc xml:space="preserve">Scans for a match in string for the pattern in @regex.
+ <doc xml:space="preserve">Scans for a match in @string for the pattern in @regex.
The @match_options are combined with the match options specified
when the @regex structure was created, letting you have more
flexibility in reusing #GRegex structures.
string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern
that begins with any kind of lookbehind assertion, such as "\b".
+Unless %G_REGEX_RAW is specified in the options, @string must be valid UTF-8.
+
A #GMatchInfo structure, used to get information on the match, is
stored in @match_info if not %NULL. Note that if @match_info is
not %NULL then it is created even if the function returns %FALSE,
</instance-parameter>
<parameter name="string" transfer-ownership="none">
<doc xml:space="preserve">the string to scan for matches</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
+ <array length="1" zero-terminated="0" c:type="const gchar*">
<type name="utf8" c:type="gchar"/>
</array>
</parameter>
<parameter name="string_len" transfer-ownership="none">
- <doc xml:space="preserve">the length of @string, or -1 if @string is nul-terminated</doc>
+ <doc xml:space="preserve">the length of @string, in bytes, or -1 if @string is nul-terminated</doc>
<type name="gssize" c:type="gssize"/>
</parameter>
<parameter name="start_position" transfer-ownership="none">
</instance-parameter>
<parameter name="string" transfer-ownership="none">
<doc xml:space="preserve">the string to perform matches against</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
+ <array length="1" zero-terminated="0" c:type="const gchar*">
<type name="utf8" c:type="gchar"/>
</array>
</parameter>
<parameter name="string_len" transfer-ownership="none">
- <doc xml:space="preserve">the length of @string, or -1 if @string is nul-terminated</doc>
+ <doc xml:space="preserve">the length of @string, in bytes, or -1 if @string is nul-terminated</doc>
<type name="gssize" c:type="gssize"/>
</parameter>
<parameter name="start_position" transfer-ownership="none">
</instance-parameter>
<parameter name="string" transfer-ownership="none">
<doc xml:space="preserve">string to perform matches against</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
+ <array length="1" zero-terminated="0" c:type="const gchar*">
<type name="utf8" c:type="gchar"/>
</array>
</parameter>
<parameter name="string_len" transfer-ownership="none">
- <doc xml:space="preserve">the length of @string, or -1 if @string is nul-terminated</doc>
+ <doc xml:space="preserve">the length of @string, in bytes, or -1 if @string is nul-terminated</doc>
<type name="gssize" c:type="gssize"/>
</parameter>
<parameter name="start_position" transfer-ownership="none">
</instance-parameter>
<parameter name="string" transfer-ownership="none">
<doc xml:space="preserve">the string to perform matches against</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
+ <array length="1" zero-terminated="0" c:type="const gchar*">
<type name="utf8" c:type="gchar"/>
</array>
</parameter>
<parameter name="string_len" transfer-ownership="none">
- <doc xml:space="preserve">the length of @string, or -1 if @string is nul-terminated</doc>
+ <doc xml:space="preserve">the length of @string, in bytes, or -1 if @string is nul-terminated</doc>
<type name="gssize" c:type="gssize"/>
</parameter>
<parameter name="start_position" transfer-ownership="none">
</instance-parameter>
<parameter name="string" transfer-ownership="none">
<doc xml:space="preserve">the string to split with the pattern</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
+ <array length="1" zero-terminated="0" c:type="const gchar*">
<type name="utf8" c:type="gchar"/>
</array>
</parameter>
<parameter name="string_len" transfer-ownership="none">
- <doc xml:space="preserve">the length of @string, or -1 if @string is nul-terminated</doc>
+ <doc xml:space="preserve">the length of @string, in bytes, or -1 if @string is nul-terminated</doc>
<type name="gssize" c:type="gssize"/>
</parameter>
<parameter name="start_position" transfer-ownership="none">
<parameters>
<parameter name="string" transfer-ownership="none">
<doc xml:space="preserve">the string to escape</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
+ <array length="1" zero-terminated="0" c:type="const gchar*">
<type name="utf8" c:type="gchar"/>
</array>
</parameter>
<parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">the length of @string, or -1 if @string is nul-terminated</doc>
+ <doc xml:space="preserve">the length of @string, in bytes, or -1 if @string is nul-terminated</doc>
<type name="gint" c:type="gint"/>
</parameter>
</parameters>
In contrast with g_slist_copy(), this function uses @func to make a copy of
each list element, in addition to copying the list container itself.
-@func, as a #GCopyFunc, takes two arguments, the data to be copied and a user
-pointer. It's safe to pass #NULL as user_data, if the copy function takes only
-one argument.
+@func, as a #GCopyFunc, takes two arguments, the data to be copied
+and a @user_data pointer. On common processor architectures, it's safe to
+pass %NULL as @user_data if the copy function takes only one argument. You
+may get compiler warnings from this though if compiling with GCC’s
+`-Wcast-function-type` warning.
For instance, if @list holds a list of GObjects, you can do:
|[<!-- language="C" -->
g_slist_free_full (another_list, g_object_unref);
]|</doc>
<return-value>
- <doc xml:space="preserve">a full copy of @list, use #g_slist_free_full to free it</doc>
+ <doc xml:space="preserve">a full copy of @list, use g_slist_free_full() to free it</doc>
<type name="GLib.SList" c:type="GSList*">
<type name="gpointer" c:type="gpointer"/>
</type>
</parameters>
</method>
<method name="insert_sorted" c:identifier="g_sequence_insert_sorted" version="2.14" introspectable="0">
- <doc xml:space="preserve">Inserts @data into @sequence using @func to determine the new
+ <doc xml:space="preserve">Inserts @data into @seq using @cmp_func to determine the new
position. The sequence must already be sorted according to @cmp_func;
otherwise the new position of @data is undefined.
-@cmp_func is called with two items of the @seq and @user_data.
+@cmp_func is called with two items of the @seq, and @cmp_data.
It should return 0 if the items are equal, a negative value
if the first item comes before the second, and a positive value
-if the second item comes before the first.
+if the second item comes before the first.
Note that when adding a large amount of data to a #GSequence,
it is more efficient to do unsorted insertions and then call
value if the first iterator comes before the second, and a
positive value if the second iterator comes before the first.
-It is called with two iterators pointing into @seq. It should
-return 0 if the iterators are equal, a negative value if the
-first iterator comes before the second, and a positive value
-if the second iterator comes before the first.
-
Note that when adding a large amount of data to a #GSequence,
it is more efficient to do unsorted insertions and then call
g_sequence_sort() or g_sequence_sort_iter().</doc>
<type name="SequenceIterCompareFunc" c:type="GSequenceIterCompareFunc"/>
</parameter>
<parameter name="cmp_data" transfer-ownership="none" nullable="1" allow-none="1">
- <doc xml:space="preserve">user data passed to @cmp_func</doc>
+ <doc xml:space="preserve">user data passed to @iter_cmp</doc>
<type name="gpointer" c:type="gpointer"/>
</parameter>
</parameters>
returned. In that case, you can use g_sequence_iter_next() and
g_sequence_iter_prev() to get others.
-@cmp_func is called with two items of the @seq and @user_data.
+@cmp_func is called with two items of the @seq, and @cmp_data.
It should return 0 if the items are equal, a negative value if
the first item comes before the second, and a positive value if
the second item comes before the first.
unsorted.</doc>
<return-value transfer-ownership="none" nullable="1">
<doc xml:space="preserve">an #GSequenceIter pointing to the position of
- the first item found equal to @data according to @cmp_func
+ the first item found equal to @data according to @iter_cmp
and @cmp_data, or %NULL if no such item exists</doc>
<type name="SequenceIter" c:type="GSequenceIter*"/>
</return-value>
<doc xml:space="preserve">Returns an iterator pointing to the position where @data would
be inserted according to @cmp_func and @cmp_data.
-@cmp_func is called with two items of the @seq and @user_data.
+@cmp_func is called with two items of the @seq, and @cmp_data.
It should return 0 if the items are equal, a negative value if
the first item comes before the second, and a positive value if
the second item comes before the first.
</method>
<method name="sort_iter" c:identifier="g_sequence_sort_iter" version="2.14" introspectable="0">
<doc xml:space="preserve">Like g_sequence_sort(), but uses a #GSequenceIterCompareFunc instead
-of a GCompareDataFunc as the compare function
+of a #GCompareDataFunc as the compare function
@cmp_func is called with two iterators pointing into @seq. It should
return 0 if the iterators are equal, a negative value if the first
</parameters>
</function>
<function name="move_range" c:identifier="g_sequence_move_range" version="2.14">
- <doc xml:space="preserve">Inserts the (@begin, @end) range at the destination pointed to by ptr.
+ <doc xml:space="preserve">Inserts the (@begin, @end) range at the destination pointed to by @dest.
The @begin and @end iters must point into the same sequence. It is
allowed for @dest to point to a different sequence than the one pointed
into by @begin and @end.
-If @dest is NULL, the range indicated by @begin and @end is
-removed from the sequence. If @dest iter points to a place within
+If @dest is %NULL, the range indicated by @begin and @end is
+removed from the sequence. If @dest points to a place within
the (@begin, @end) range, the range does not move.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</parameters>
</function>
<function name="sort_changed" c:identifier="g_sequence_sort_changed" version="2.14" introspectable="0">
- <doc xml:space="preserve">Moves the data pointed to a new position as indicated by @cmp_func. This
+ <doc xml:space="preserve">Moves the data pointed to by @iter to a new position as indicated by
+@cmp_func. This
function should be called for items in a sequence already sorted according
to @cmp_func whenever some aspect of an item changes so that @cmp_func
may return different values for that item.
-@cmp_func is called with two items of the @seq and @user_data.
+@cmp_func is called with two items of the @seq, and @cmp_data.
It should return 0 if the items are equal, a negative value if
the first item comes before the second, and a positive value if
the second item comes before the first.</doc>
a #GSequenceIterCompareFunc instead of a #GCompareDataFunc as
the compare function.
-@iter_cmp is called with two iterators pointing into @seq. It should
+@iter_cmp is called with two iterators pointing into the #GSequence that
+@iter points into. It should
return 0 if the iterators are equal, a negative value if the first
iterator comes before the second, and a positive value if the second
iterator comes before the first.</doc>
<doc xml:space="preserve">Returns the numeric ID for a particular source. The ID of a source
is a positive integer which is unique within a particular main loop
context. The reverse
-mapping from ID to source is done by g_main_context_find_source_by_id().</doc>
+mapping from ID to source is done by g_main_context_find_source_by_id().
+
+You can only call this function while the source is associated to a
+#GMainContext instance; calling this function before g_source_attach()
+or after g_source_destroy() yields undefined behavior. The ID returned
+is unique within the #GMainContext instance passed to g_source_attach().</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">the ID (greater than 0) for the source</doc>
<type name="guint" c:type="guint"/>
The exact type of @func depends on the type of source; ie. you
should not count on @func being called with @data as its first
-parameter.
+parameter. Cast @func with G_SOURCE_FUNC() to avoid warnings about
+incompatible function types.
See [memory management of sources][mainloop-memory-management] for details
on how to handle memory management of @data.
</callback>
<callback name="SourceFunc" c:type="GSourceFunc">
<doc xml:space="preserve">Specifies the type of function passed to g_timeout_add(),
-g_timeout_add_full(), g_idle_add(), and g_idle_add_full().</doc>
+g_timeout_add_full(), g_idle_add(), and g_idle_add_full().
+
+When calling g_source_set_callback(), you may need to cast a function of a
+different type to this type. Use G_SOURCE_FUNC() to avoid warnings about
+incompatible function types.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%FALSE if the source should be removed. #G_SOURCE_CONTINUE and
#G_SOURCE_REMOVE are more memorable names for the return value.</doc>
GLib is attempting to unify around the use of 64bit integers to
represent microsecond-precision time. As such, this type will be
-removed from a future version of GLib.</doc>
+removed from a future version of GLib. A consequence of using `glong` for
+`tv_sec` is that on 32-bit systems `GTimeVal` is subject to the year 2038
+problem.</doc>
<field name="tv_sec" writable="1">
<doc xml:space="preserve">seconds</doc>
<type name="glong" c:type="glong"/>
variation of ISO 8601 format is required.
If @time_ represents a date which is too large to fit into a `struct tm`,
-%NULL will be returned. This is platform dependent, but it is safe to assume
-years up to 3000 are supported. The return value of g_time_val_to_iso8601()
-has been nullable since GLib 2.54; before then, GLib would crash under the
-same conditions.</doc>
+%NULL will be returned. This is platform dependent. Note also that since
+`GTimeVal` stores the number of seconds as a `glong`, on 32-bit systems it
+is subject to the year 2038 problem.
+
+The return value of g_time_val_to_iso8601() has been nullable since GLib
+2.54; before then, GLib would crash under the same conditions.</doc>
<return-value transfer-ownership="full" nullable="1">
<doc xml:space="preserve">a newly allocated string containing an ISO 8601 date,
or %NULL if @time_ was too large</doc>
@iso_date must include year, month, day, hours, minutes, and
seconds. It can optionally include fractions of a second and a time
zone indicator. (In the absence of any time zone indication, the
-timestamp is assumed to be in local time.)</doc>
+timestamp is assumed to be in local time.)
+
+Any leading or trailing space in @iso_date is ignored.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE if the conversion was successful.</doc>
<type name="gboolean" c:type="gboolean"/>
<type name="TimeZone" c:type="GTimeZone*"/>
</return-value>
</constructor>
+ <constructor name="new_offset" c:identifier="g_time_zone_new_offset" version="2.58">
+ <doc xml:space="preserve">Creates a #GTimeZone corresponding to the given constant offset from UTC,
+in seconds.
+
+This is equivalent to calling g_time_zone_new() with a string in the form
+`[+|-]hh[:mm[:ss]]`.</doc>
+ <return-value transfer-ownership="full">
+ <doc xml:space="preserve">a timezone at the given offset from UTC</doc>
+ <type name="TimeZone" c:type="GTimeZone*"/>
+ </return-value>
+ <parameters>
+ <parameter name="seconds" transfer-ownership="none">
+ <doc xml:space="preserve">offset to UTC, in seconds</doc>
+ <type name="gint32" c:type="gint32"/>
+ </parameter>
+ </parameters>
+ </constructor>
<constructor name="new_utc" c:identifier="g_time_zone_new_utc" version="2.26">
<doc xml:space="preserve">Creates a #GTimeZone corresponding to UTC.
</parameter>
</parameters>
</method>
+ <method name="get_identifier" c:identifier="g_time_zone_get_identifier" version="2.58">
+ <doc xml:space="preserve">Get the identifier of this #GTimeZone, as passed to g_time_zone_new().
+If the identifier passed at construction time was not recognised, `UTC` will
+be returned. If it was %NULL, the identifier of the local timezone at
+construction time will be returned.
+
+The identifier will be returned in the same format as provided at
+construction time: if provided as a time offset, that will be returned by
+this function.</doc>
+ <return-value transfer-ownership="none">
+ <doc xml:space="preserve">identifier for this timezone</doc>
+ <type name="utf8" c:type="const gchar*"/>
+ </return-value>
+ <parameters>
+ <instance-parameter name="tz" transfer-ownership="none">
+ <doc xml:space="preserve">a #GTimeZone</doc>
+ <type name="TimeZone" c:type="GTimeZone*"/>
+ </instance-parameter>
+ </parameters>
+ </method>
<method name="get_offset" c:identifier="g_time_zone_get_offset" version="2.26">
<doc xml:space="preserve">Determines the offset to UTC in effect during a particular @interval
of time in the time zone @tz.
<member name="zanabazar_square" value="141" c:identifier="G_UNICODE_SCRIPT_ZANABAZAR_SQUARE">
<doc xml:space="preserve">Zanabazar Square. Since: 2.54</doc>
</member>
+ <member name="dogra" value="142" c:identifier="G_UNICODE_SCRIPT_DOGRA">
+ <doc xml:space="preserve">Dogra. Since: 2.58</doc>
+ </member>
+ <member name="gunjala_gondi" value="143" c:identifier="G_UNICODE_SCRIPT_GUNJALA_GONDI">
+ <doc xml:space="preserve">Gunjala Gondi. Since: 2.58</doc>
+ </member>
+ <member name="hanifi_rohingya" value="144" c:identifier="G_UNICODE_SCRIPT_HANIFI_ROHINGYA">
+ <doc xml:space="preserve">Hanifi Rohingya. Since: 2.58</doc>
+ </member>
+ <member name="makasar" value="145" c:identifier="G_UNICODE_SCRIPT_MAKASAR">
+ <doc xml:space="preserve">Makasar. Since: 2.58</doc>
+ </member>
+ <member name="medefaidrin" value="146" c:identifier="G_UNICODE_SCRIPT_MEDEFAIDRIN">
+ <doc xml:space="preserve">Medefaidrin. Since: 2.58</doc>
+ </member>
+ <member name="old_sogdian" value="147" c:identifier="G_UNICODE_SCRIPT_OLD_SOGDIAN">
+ <doc xml:space="preserve">Old Sogdian. Since: 2.58</doc>
+ </member>
+ <member name="sogdian" value="148" c:identifier="G_UNICODE_SCRIPT_SOGDIAN">
+ <doc xml:space="preserve">Sogdian. Since: 2.58</doc>
+ </member>
</enumeration>
<enumeration name="UnicodeType" c:type="GUnicodeType">
<doc xml:space="preserve">These are the possible character classifications from the
<parameter name="children" transfer-ownership="none" nullable="1" allow-none="1">
<doc xml:space="preserve">an array of
#GVariant pointers, the children</doc>
- <array length="2" zero-terminated="0" c:type="GVariant**">
+ <array length="2" zero-terminated="0" c:type="GVariant* const*">
<type name="Variant" c:type="GVariant*"/>
</array>
</parameter>
<parameters>
<parameter name="value" transfer-ownership="none">
<doc xml:space="preserve">a #guint8 value</doc>
- <type name="guint8" c:type="guchar"/>
+ <type name="guint8" c:type="guint8"/>
</parameter>
</parameters>
</constructor>
<parameter name="string" transfer-ownership="none">
<doc xml:space="preserve">a normal
nul-terminated string in no particular encoding</doc>
- <array c:type="gchar*">
+ <array c:type="const gchar*">
<type name="guint8"/>
</array>
</parameter>
<parameters>
<parameter name="strv" transfer-ownership="none">
<doc xml:space="preserve">an array of strings</doc>
- <array length="1" zero-terminated="0" c:type="gchar**">
+ <array length="1" zero-terminated="0" c:type="const gchar* const*">
<type name="utf8" c:type="gchar*"/>
</array>
</parameter>
<parameters>
<parameter name="strv" transfer-ownership="none">
<doc xml:space="preserve">an array of strings</doc>
- <array length="1" zero-terminated="0" c:type="gchar**">
+ <array length="1" zero-terminated="0" c:type="const gchar* const*">
<type name="utf8"/>
</array>
</parameter>
<parameters>
<parameter name="strv" transfer-ownership="none">
<doc xml:space="preserve">an array of strings</doc>
- <array length="1" zero-terminated="0" c:type="gchar**">
+ <array length="1" zero-terminated="0" c:type="const gchar* const*">
<type name="utf8"/>
</array>
</parameter>
<parameters>
<parameter name="children" transfer-ownership="none">
<doc xml:space="preserve">the items to make the tuple out of</doc>
- <array length="1" zero-terminated="0" c:type="GVariant**">
+ <array length="1" zero-terminated="0" c:type="GVariant* const*">
<type name="Variant" c:type="GVariant*"/>
</array>
</parameter>
It is an error to call this function with a @value of any type
other than %G_VARIANT_TYPE_BYTE.</doc>
<return-value transfer-ownership="none">
- <doc xml:space="preserve">a #guchar</doc>
- <type name="guint8" c:type="guchar"/>
+ <doc xml:space="preserve">a #guint8</doc>
+ <type name="guint8" c:type="guint8"/>
</return-value>
<parameters>
<instance-parameter name="value" transfer-ownership="none">
<return-value transfer-ownership="none">
<doc xml:space="preserve">
the constant string</doc>
- <array c:type="gchar*">
+ <array c:type="const gchar*">
<type name="guint8"/>
</array>
</return-value>
%NULL pointer will be returned.</doc>
<return-value transfer-ownership="container">
<doc xml:space="preserve">an array of constant strings</doc>
- <array length="0" zero-terminated="0" c:type="gchar**">
+ <array length="0" zero-terminated="0" c:type="const gchar**">
<type name="utf8"/>
</array>
</return-value>
The returned value is never floating. You should free it with
g_variant_unref() when you're done with it.
+There may be implementation specific restrictions on deeply nested values,
+which would result in the unit tuple being returned as the child value,
+instead of further nested children. #GVariant is guaranteed to handle
+nesting up to at least 64 levels.
+
This function is O(1).</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">the child at the specified index</doc>
the appropriate type:
- %G_VARIANT_TYPE_INT16 (etc.): #gint16 (etc.)
- %G_VARIANT_TYPE_BOOLEAN: #guchar (not #gboolean!)
-- %G_VARIANT_TYPE_BYTE: #guchar
+- %G_VARIANT_TYPE_BYTE: #guint8
- %G_VARIANT_TYPE_HANDLE: #guint32
- %G_VARIANT_TYPE_DOUBLE: #gdouble
%NULL pointer will be returned.</doc>
<return-value transfer-ownership="container">
<doc xml:space="preserve">an array of constant strings</doc>
- <array length="0" zero-terminated="1" c:type="gchar**">
+ <array length="0" zero-terminated="1" c:type="const gchar**">
<type name="utf8"/>
</array>
</return-value>
%NULL pointer will be returned.</doc>
<return-value transfer-ownership="container">
<doc xml:space="preserve">an array of constant strings</doc>
- <array length="0" zero-terminated="1" c:type="gchar**">
+ <array length="0" zero-terminated="1" c:type="const gchar**">
<type name="utf8"/>
</array>
</return-value>
If @value is found to be in normal form then it will be marked as
being trusted. If the value was already marked as being trusted then
-this function will immediately return %TRUE.</doc>
+this function will immediately return %TRUE.
+
+There may be implementation specific restrictions on deeply nested values.
+GVariant is guaranteed to handle nesting up to at least 64 levels.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE if @value is in normal form</doc>
<type name="gboolean" c:type="gboolean"/>
should ensure that a string is a valid D-Bus object path before
passing it to g_variant_new_object_path().
-A valid object path starts with '/' followed by zero or more
-sequences of characters separated by '/' characters. Each sequence
-must contain only the characters "[A-Z][a-z][0-9]_". No sequence
-(including the one following the final '/' character) may be empty.</doc>
+A valid object path starts with `/` followed by zero or more
+sequences of characters separated by `/` characters. Each sequence
+must contain only the characters `[A-Z][a-z][0-9]_`. No sequence
+(including the one following the final `/` character) may be empty.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE if @string is a D-Bus object path</doc>
<type name="gboolean" c:type="gboolean"/>
The above definition is recursive to arbitrary depth. "aaaaai" and
"(ui(nq((y)))s)" are both valid type strings, as is
-"a(aa(ui)(qna{ya(yd)}))".
+"a(aa(ui)(qna{ya(yd)}))". In order to not hit memory limits, #GVariant
+imposes a limit on recursion depth of 65 nested containers. This is the
+limit in the D-Bus specification (64) plus one to allow a #GDBusMessage to
+be nested in a top-level tuple.
The meaning of each of the characters is as follows:
- `b`: the type string of %G_VARIANT_TYPE_BOOLEAN; a boolean value.
<parameters>
<parameter name="items" transfer-ownership="none">
<doc xml:space="preserve">an array of #GVariantTypes, one for each item</doc>
- <array length="1" zero-terminated="0" c:type="GVariantType**">
+ <array length="1" zero-terminated="0" c:type="const GVariantType* const*">
<type name="VariantType" c:type="GVariantType*"/>
</array>
</parameter>
</parameter>
</parameters>
</function>
+ <function name="atomic_rc_box_acquire" c:identifier="g_atomic_rc_box_acquire" version="2.58">
+ <doc xml:space="preserve">Atomically acquires a reference on the data pointed by @mem_block.</doc>
+ <return-value transfer-ownership="full">
+ <doc xml:space="preserve">a pointer to the data,
+ with its reference count increased</doc>
+ <type name="gpointer" c:type="gpointer"/>
+ </return-value>
+ <parameters>
+ <parameter name="mem_block" transfer-ownership="none">
+ <doc xml:space="preserve">a pointer to reference counted data</doc>
+ <type name="gpointer" c:type="gpointer"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="atomic_rc_box_alloc" c:identifier="g_atomic_rc_box_alloc" version="2.58">
+ <doc xml:space="preserve">Allocates @block_size bytes of memory, and adds atomic
+reference counting semantics to it.
+
+The data will be freed when its reference count drops to
+zero.</doc>
+ <return-value transfer-ownership="full">
+ <doc xml:space="preserve">a pointer to the allocated memory</doc>
+ <type name="gpointer" c:type="gpointer"/>
+ </return-value>
+ <parameters>
+ <parameter name="block_size" transfer-ownership="none">
+ <doc xml:space="preserve">the size of the allocation, must be greater than 0</doc>
+ <type name="gsize" c:type="gsize"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="atomic_rc_box_alloc0" c:identifier="g_atomic_rc_box_alloc0" version="2.58">
+ <doc xml:space="preserve">Allocates @block_size bytes of memory, and adds atomic
+referenc counting semantics to it.
+
+The contents of the returned data is set to zero.
+
+The data will be freed when its reference count drops to
+zero.</doc>
+ <return-value transfer-ownership="full">
+ <doc xml:space="preserve">a pointer to the allocated memory</doc>
+ <type name="gpointer" c:type="gpointer"/>
+ </return-value>
+ <parameters>
+ <parameter name="block_size" transfer-ownership="none">
+ <doc xml:space="preserve">the size of the allocation, must be greater than 0</doc>
+ <type name="gsize" c:type="gsize"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="atomic_rc_box_dup" c:identifier="g_atomic_rc_box_dup" version="2.58">
+ <doc xml:space="preserve">Allocates a new block of data with atomit reference counting
+semantics, and copies @block_size bytes of @mem_block
+into it.</doc>
+ <return-value transfer-ownership="full">
+ <doc xml:space="preserve">a pointer to the allocated
+ memory</doc>
+ <type name="gpointer" c:type="gpointer"/>
+ </return-value>
+ <parameters>
+ <parameter name="block_size" transfer-ownership="none">
+ <doc xml:space="preserve">the number of bytes to copy, must be greater than 0</doc>
+ <type name="gsize" c:type="gsize"/>
+ </parameter>
+ <parameter name="mem_block" transfer-ownership="none">
+ <doc xml:space="preserve">the memory to copy</doc>
+ <type name="gpointer" c:type="gconstpointer"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="atomic_rc_box_get_size" c:identifier="g_atomic_rc_box_get_size" version="2.58">
+ <doc xml:space="preserve">Retrieves the size of the reference counted data pointed by @mem_block.</doc>
+ <return-value transfer-ownership="none">
+ <doc xml:space="preserve">the size of the data, in bytes</doc>
+ <type name="gsize" c:type="gsize"/>
+ </return-value>
+ <parameters>
+ <parameter name="mem_block" transfer-ownership="none">
+ <doc xml:space="preserve">a pointer to reference counted data</doc>
+ <type name="gpointer" c:type="gpointer"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="atomic_rc_box_release" c:identifier="g_atomic_rc_box_release" version="2.58">
+ <doc xml:space="preserve">Atomically releases a reference on the data pointed by @mem_block.
+
+If the reference was the last one, it will free the
+resources allocated for @mem_block.</doc>
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+ <parameters>
+ <parameter name="mem_block" transfer-ownership="full">
+ <doc xml:space="preserve">a pointer to reference counted data</doc>
+ <type name="gpointer" c:type="gpointer"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="atomic_rc_box_release_full" c:identifier="g_atomic_rc_box_release_full" version="2.58">
+ <doc xml:space="preserve">Atomically releases a reference on the data pointed by @mem_block.
+
+If the reference was the last one, it will call @clear_func
+to clear the contents of @mem_block, and then will free the
+resources allocated for @mem_block.</doc>
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+ <parameters>
+ <parameter name="mem_block" transfer-ownership="full">
+ <doc xml:space="preserve">a pointer to reference counted data</doc>
+ <type name="gpointer" c:type="gpointer"/>
+ </parameter>
+ <parameter name="clear_func" transfer-ownership="none" scope="async">
+ <doc xml:space="preserve">a function to call when clearing the data</doc>
+ <type name="DestroyNotify" c:type="GDestroyNotify"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="atomic_ref_count_compare" c:identifier="g_atomic_ref_count_compare" version="2.58">
+ <doc xml:space="preserve">Atomically compares the current value of @arc with @val.</doc>
+ <return-value transfer-ownership="none">
+ <doc xml:space="preserve">%TRUE if the reference count is the same
+ as the given value</doc>
+ <type name="gboolean" c:type="gboolean"/>
+ </return-value>
+ <parameters>
+ <parameter name="arc" transfer-ownership="none">
+ <doc xml:space="preserve">the address of an atomic reference count variable</doc>
+ <type name="gint" c:type="gatomicrefcount*"/>
+ </parameter>
+ <parameter name="val" transfer-ownership="none">
+ <doc xml:space="preserve">the value to compare</doc>
+ <type name="gint" c:type="gint"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="atomic_ref_count_dec" c:identifier="g_atomic_ref_count_dec" version="2.58">
+ <doc xml:space="preserve">Atomically decreases the reference count.</doc>
+ <return-value transfer-ownership="none">
+ <doc xml:space="preserve">%TRUE if the reference count reached 0, and %FALSE otherwise</doc>
+ <type name="gboolean" c:type="gboolean"/>
+ </return-value>
+ <parameters>
+ <parameter name="arc" transfer-ownership="none">
+ <doc xml:space="preserve">the address of an atomic reference count variable</doc>
+ <type name="gint" c:type="gatomicrefcount*"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="atomic_ref_count_inc" c:identifier="g_atomic_ref_count_inc" version="2.58">
+ <doc xml:space="preserve">Atomically increases the reference count.</doc>
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+ <parameters>
+ <parameter name="arc" transfer-ownership="none">
+ <doc xml:space="preserve">the address of an atomic reference count variable</doc>
+ <type name="gint" c:type="gatomicrefcount*"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="atomic_ref_count_init" c:identifier="g_atomic_ref_count_init" version="2.58">
+ <doc xml:space="preserve">Atomically initializes a reference count variable.</doc>
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+ <parameters>
+ <parameter name="arc" transfer-ownership="none">
+ <doc xml:space="preserve">the address of an atomic reference count variable</doc>
+ <type name="gint" c:type="gatomicrefcount*"/>
+ </parameter>
+ </parameters>
+ </function>
<function name="base64_decode" c:identifier="g_base64_decode" version="2.12">
<doc xml:space="preserve">Decode a sequence of Base-64 encoded text into binary data. Note
that the returned binary data is not necessarily zero-terminated,
<parameters>
<parameter name="in" transfer-ownership="none">
<doc xml:space="preserve">binary input data</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
+ <array length="1" zero-terminated="0" c:type="const gchar*">
<type name="guint8"/>
</array>
</parameter>
<parameters>
<parameter name="data" transfer-ownership="none">
<doc xml:space="preserve">the binary data to encode</doc>
- <array length="1" zero-terminated="0" c:type="guchar*">
+ <array length="1" zero-terminated="0" c:type="const guchar*">
<type name="guint8"/>
</array>
</parameter>
<parameters>
<parameter name="in" transfer-ownership="none">
<doc xml:space="preserve">the binary data to encode</doc>
- <array length="1" zero-terminated="0" c:type="guchar*">
+ <array length="1" zero-terminated="0" c:type="const guchar*">
<type name="guint8"/>
</array>
</parameter>
</parameter>
</parameters>
</function>
+ <function name="canonicalize_filename" c:identifier="g_canonicalize_filename" version="2.58">
+ <doc xml:space="preserve">Gets the canonical file name from @filename. All triple slashes are turned into
+single slashes, and all `..` and `.`s resolved against @relative_to.
+
+Symlinks are not followed, and the returned path is guaranteed to be absolute.
+
+If @filename is an absolute path, @relative_to is ignored. Otherwise,
+@relative_to will be prepended to @filename to make it absolute. @relative_to
+must be an absolute path, or %NULL. If @relative_to is %NULL, it'll fallback
+to g_get_current_dir().
+
+This function never fails, and will canonicalize file paths even if they don't
+exist.
+
+No file system I/O is done.</doc>
+ <return-value transfer-ownership="full">
+ <doc xml:space="preserve">a newly allocated string with the
+canonical file path</doc>
+ <type name="filename" c:type="gchar*"/>
+ </return-value>
+ <parameters>
+ <parameter name="filename" transfer-ownership="none">
+ <doc xml:space="preserve">the name of the file</doc>
+ <type name="filename" c:type="const gchar*"/>
+ </parameter>
+ <parameter name="relative_to" transfer-ownership="none" nullable="1" allow-none="1">
+ <doc xml:space="preserve">the relative directory, or %NULL
+to use the current working directory</doc>
+ <type name="filename" c:type="const gchar*"/>
+ </parameter>
+ </parameters>
+ </function>
<function name="chdir" c:identifier="g_chdir" version="2.8">
<doc xml:space="preserve">A wrapper for the POSIX chdir() function. The function changes the
current directory of the process to @path.
pointer is set to %NULL.
A macro is also included that allows this function to be used without
-pointer casts.</doc>
+pointer casts. This will mask any warnings about incompatible function types
+or calling conventions, so you must ensure that your @destroy function is
+compatible with being called as `GDestroyNotify` using the standard calling
+convention for the platform that GLib was compiled for; otherwise the program
+will experience undefined behaviour.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
</parameter>
<parameter name="data" transfer-ownership="none">
<doc xml:space="preserve">binary blob to compute the digest of</doc>
- <array length="2" zero-terminated="0" c:type="guchar*">
+ <array length="2" zero-terminated="0" c:type="const guchar*">
<type name="guint8"/>
</array>
</parameter>
</parameter>
<parameter name="key" transfer-ownership="none">
<doc xml:space="preserve">the key to use in the HMAC</doc>
- <array length="2" zero-terminated="0" c:type="guchar*">
+ <array length="2" zero-terminated="0" c:type="const guchar*">
<type name="guint8" c:type="guchar"/>
</array>
</parameter>
</parameter>
<parameter name="data" transfer-ownership="none">
<doc xml:space="preserve">binary blob to compute the HMAC of</doc>
- <array length="4" zero-terminated="0" c:type="guchar*">
+ <array length="4" zero-terminated="0" c:type="const guchar*">
<type name="guint8" c:type="guchar"/>
</array>
</parameter>
</parameter>
<parameter name="key" transfer-ownership="none">
<doc xml:space="preserve">the key to use in the HMAC</doc>
- <array length="2" zero-terminated="0" c:type="guchar*">
+ <array length="2" zero-terminated="0" c:type="const guchar*">
<type name="guint8" c:type="guchar"/>
</array>
</parameter>
<parameter name="str" transfer-ownership="none">
<doc xml:space="preserve">
the string to convert.</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
+ <array length="1" zero-terminated="0" c:type="const gchar*">
<type name="guint8"/>
</array>
</parameter>
<parameter name="str" transfer-ownership="none">
<doc xml:space="preserve">
the string to convert.</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
+ <array length="1" zero-terminated="0" c:type="const gchar*">
<type name="guint8"/>
</array>
</parameter>
<parameter name="str" transfer-ownership="none">
<doc xml:space="preserve">
the string to convert.</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
+ <array length="1" zero-terminated="0" c:type="const gchar*">
<type name="guint8"/>
</array>
</parameter>
lists, metadata etc. may be lost. If @filename is a symbolic link,
the link itself will be replaced, not the linked file.
+- On UNIX, if @filename already exists and is non-empty, and if the system
+ supports it (via a journalling filesystem or equivalent), the fsync()
+ call (or equivalent) will be used to ensure atomic replacement: @filename
+ will contain either its old contents or @contents, even in the face of
+ system power loss, the disk being unsafely removed, etc.
+
+- On UNIX, if @filename does not already exist or is empty, there is a
+ possibility that system power loss etc. after calling this function will
+ leave @filename empty or full of NUL bytes, depending on the underlying
+ filesystem.
+
- On Windows renaming a file will not remove an existing file with the
new name, so on Windows there is a race condition between the existing
file being removed and the temporary file being renamed.
</parameter>
<parameter name="contents" transfer-ownership="none">
<doc xml:space="preserve">string to write to the file</doc>
- <array length="2" zero-terminated="0" c:type="gchar*">
+ <array length="2" zero-terminated="0" c:type="const gchar*">
<type name="guint8"/>
</array>
</parameter>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
- <parameter name="charsets" transfer-ownership="none">
- <type name="utf8" c:type="const gchar***"/>
+ <parameter name="filename_charsets" direction="out" caller-allocates="0" transfer-ownership="none">
+ <doc xml:space="preserve">
+ return location for the %NULL-terminated list of encoding names</doc>
+ <array c:type="const gchar***">
+ <type name="utf8" c:type="gchar**"/>
+ </array>
</parameter>
</parameters>
</function>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a %NULL-terminated array of strings owned by GLib
that must not be modified or freed.</doc>
- <array c:type="gchar**">
+ <array c:type="const gchar* const*">
<type name="utf8"/>
</array>
</return-value>
</function>
+ <function name="get_language_names_with_category" c:identifier="g_get_language_names_with_category" version="2.58">
+ <doc xml:space="preserve">Computes a list of applicable locale names with a locale category name,
+which can be used to construct the fallback locale-dependent filenames
+or search paths. The returned list is sorted from most desirable to
+least desirable and always contains the default locale "C".
+
+This function consults the environment variables `LANGUAGE`, `LC_ALL`,
+@category_name, and `LANG` to find the list of locales specified by the
+user.
+
+g_get_language_names() returns g_get_language_names_with_category("LC_MESSAGES").</doc>
+ <return-value transfer-ownership="none">
+ <doc xml:space="preserve">a %NULL-terminated array of strings owned by GLib
+ that must not be modified or freed.</doc>
+ <array c:type="const gchar* const*">
+ <type name="utf8"/>
+ </array>
+ </return-value>
+ <parameters>
+ <parameter name="category_name" transfer-ownership="none">
+ <doc xml:space="preserve">a locale category name</doc>
+ <type name="utf8" c:type="const gchar*"/>
+ </parameter>
+ </parameters>
+ </function>
<function name="get_locale_variants" c:identifier="g_get_locale_variants" version="2.28">
<doc xml:space="preserve">Returns a list of derived variants of @locale, which can be used to
e.g. construct locale-dependent filenames or search paths. The returned
<doc xml:space="preserve">
a %NULL-terminated array of strings owned by GLib that must not be
modified or freed.</doc>
- <array c:type="gchar**">
+ <array c:type="const gchar* const*">
<type name="filename"/>
</array>
</return-value>
<doc xml:space="preserve">
a %NULL-terminated array of strings owned by GLib that must not be
modified or freed.</doc>
- <array c:type="gchar**">
+ <array c:type="const gchar* const*">
<type name="filename"/>
</array>
</return-value>
</parameter>
</parameters>
</function>
+ <function name="hash_table_steal_extended" c:identifier="g_hash_table_steal_extended" moved-to="HashTable.steal_extended" version="2.58">
+ <doc xml:space="preserve">Looks up a key in the #GHashTable, stealing the original key and the
+associated value and returning %TRUE if the key was found. If the key was
+not found, %FALSE is returned.
+
+If found, the stolen key and value are removed from the hash table without
+calling the key and value destroy functions, and ownership is transferred to
+the caller of this method; as with g_hash_table_steal().
+
+You can pass %NULL for @lookup_key, provided the hash and equal functions
+of @hash_table are %NULL-safe.</doc>
+ <return-value transfer-ownership="none">
+ <doc xml:space="preserve">%TRUE if the key was found in the #GHashTable</doc>
+ <type name="gboolean" c:type="gboolean"/>
+ </return-value>
+ <parameters>
+ <parameter name="hash_table" transfer-ownership="none">
+ <doc xml:space="preserve">a #GHashTable</doc>
+ <type name="GLib.HashTable" c:type="GHashTable*">
+ <type name="gpointer" c:type="gpointer"/>
+ <type name="gpointer" c:type="gpointer"/>
+ </type>
+ </parameter>
+ <parameter name="lookup_key" transfer-ownership="none" nullable="1" allow-none="1">
+ <doc xml:space="preserve">the key to look up</doc>
+ <type name="gpointer" c:type="gconstpointer"/>
+ </parameter>
+ <parameter name="stolen_key" direction="out" caller-allocates="0" transfer-ownership="full" nullable="1" optional="1" allow-none="1">
+ <doc xml:space="preserve">return location for the
+ original key</doc>
+ <type name="gpointer" c:type="gpointer*"/>
+ </parameter>
+ <parameter name="stolen_value" direction="out" caller-allocates="0" transfer-ownership="full" nullable="1" optional="1" allow-none="1">
+ <doc xml:space="preserve">return location
+ for the value associated with the key</doc>
+ <type name="gpointer" c:type="gpointer*"/>
+ </parameter>
+ </parameters>
+ </function>
<function name="hash_table_unref" c:identifier="g_hash_table_unref" moved-to="HashTable.unref" version="2.10">
<doc xml:space="preserve">Atomically decrements the reference count of @hash_table by one.
If the reference count drops to 0, all keys and values will be
<doc xml:space="preserve">a string in the
encoding of the current locale. On Windows
this means the system codepage.</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
+ <array length="1" zero-terminated="0" c:type="const gchar*">
<type name="guint8"/>
</array>
</parameter>
<function name="log" c:identifier="g_log" introspectable="0">
<doc xml:space="preserve">Logs an error or debugging message.
-If the log level has been set as fatal, the abort()
-function is called to terminate the program.
+If the log level has been set as fatal, G_BREAKPOINT() is called
+to terminate the program. See the documentation for G_BREAKPOINT() for
+details of the debugging options this provides.
If g_log_default_handler() is used as the log handler function, a new-line
character will automatically be appended to @..., and need not be entered
allows to install an alternate default log handler.
This is used if no log handler has been set for the particular log
domain and log level combination. It outputs the message to stderr
-or stdout and if the log level is fatal it calls abort(). It automatically
+or stdout and if the log level is fatal it calls G_BREAKPOINT(). It automatically
prints a new-line character after the message, so one does not need to be
manually included in @message.
g_log_structured_array()). To change the fatal behaviour for specific log
messages, programs must install a custom log writer function using
g_log_set_writer_func(). See
-[Using Structured Logging][using-structured-logging].</doc>
+[Using Structured Logging][using-structured-logging].
+
+This function is mostly intended to be used with
+%G_LOG_LEVEL_CRITICAL. You should typically not set
+%G_LOG_LEVEL_WARNING, %G_LOG_LEVEL_MESSAGE, %G_LOG_LEVEL_INFO or
+%G_LOG_LEVEL_DEBUG as fatal except inside of test programs.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">the old fatal mask for the log domain</doc>
<type name="LogLevelFlags" c:type="GLogLevelFlags"/>
<doc xml:space="preserve">Log a message with structured data. The message will be passed through to
the log writer set by the application using g_log_set_writer_func(). If the
message is fatal (i.e. its log level is %G_LOG_LEVEL_ERROR), the program will
-be aborted at the end of this function. If the log writer returns
+be aborted by calling G_BREAKPOINT() at the end of this function. If the log writer returns
%G_LOG_WRITER_UNHANDLED (failure), no other fallback writers will be tried.
See the documentation for #GLogWriterFunc for information on chaining
writers.
<parameter name="fields" transfer-ownership="none">
<doc xml:space="preserve">key–value pairs of structured data to add
to the log message</doc>
- <array length="2" zero-terminated="0" c:type="GLogField*">
+ <array length="2" zero-terminated="0" c:type="const GLogField*">
<type name="LogField" c:type="GLogField"/>
</array>
</parameter>
<parameter name="fields" transfer-ownership="none">
<doc xml:space="preserve">key–value pairs of structured data forming
the log message</doc>
- <array length="2" zero-terminated="0" c:type="GLogField*">
+ <array length="2" zero-terminated="0" c:type="const GLogField*">
<type name="LogField" c:type="GLogField"/>
</array>
</parameter>
<parameter name="fields" transfer-ownership="none">
<doc xml:space="preserve">key–value pairs of structured data forming
the log message</doc>
- <array length="2" zero-terminated="0" c:type="GLogField*">
+ <array length="2" zero-terminated="0" c:type="const GLogField*">
<type name="LogField" c:type="GLogField"/>
</array>
</parameter>
<parameter name="fields" transfer-ownership="none">
<doc xml:space="preserve">key–value pairs of structured data forming
the log message</doc>
- <array length="2" zero-terminated="0" c:type="GLogField*">
+ <array length="2" zero-terminated="0" c:type="const GLogField*">
<type name="LogField" c:type="GLogField"/>
</array>
</parameter>
<parameter name="fields" transfer-ownership="none">
<doc xml:space="preserve">key–value pairs of structured data forming
the log message</doc>
- <array length="2" zero-terminated="0" c:type="GLogField*">
+ <array length="2" zero-terminated="0" c:type="const GLogField*">
<type name="LogField" c:type="GLogField"/>
</array>
</parameter>
<function name="logv" c:identifier="g_logv" introspectable="0">
<doc xml:space="preserve">Logs an error or debugging message.
-If the log level has been set as fatal, the abort()
-function is called to terminate the program.
+If the log level has been set as fatal, G_BREAKPOINT() is called
+to terminate the program. See the documentation for G_BREAKPOINT() for
+details of the debugging options this provides.
If g_log_default_handler() is used as the log handler function, a new-line
character will automatically be appended to @..., and need not be entered
<parameter name="keys" transfer-ownership="none">
<doc xml:space="preserve">pointer to an array of #GDebugKey which associate
strings with bit flags.</doc>
- <array length="2" zero-terminated="0" c:type="GDebugKey*">
+ <array length="2" zero-terminated="0" c:type="const GDebugKey*">
<type name="DebugKey" c:type="GDebugKey"/>
</array>
</parameter>
</parameter>
</parameters>
</function>
+ <function name="rc_box_acquire" c:identifier="g_rc_box_acquire" version="2.58">
+ <doc xml:space="preserve">Acquires a reference on the data pointed by @mem_block.</doc>
+ <return-value transfer-ownership="full">
+ <doc xml:space="preserve">a pointer to the data,
+ with its reference count increased</doc>
+ <type name="gpointer" c:type="gpointer"/>
+ </return-value>
+ <parameters>
+ <parameter name="mem_block" transfer-ownership="none">
+ <doc xml:space="preserve">a pointer to reference counted data</doc>
+ <type name="gpointer" c:type="gpointer"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="rc_box_alloc" c:identifier="g_rc_box_alloc" version="2.58">
+ <doc xml:space="preserve">Allocates @block_size bytes of memory, and adds reference
+counting semantics to it.
+
+The data will be freed when its reference count drops to
+zero.</doc>
+ <return-value transfer-ownership="full">
+ <doc xml:space="preserve">a pointer to the allocated memory</doc>
+ <type name="gpointer" c:type="gpointer"/>
+ </return-value>
+ <parameters>
+ <parameter name="block_size" transfer-ownership="none">
+ <doc xml:space="preserve">the size of the allocation, must be greater than 0</doc>
+ <type name="gsize" c:type="gsize"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="rc_box_alloc0" c:identifier="g_rc_box_alloc0" version="2.58">
+ <doc xml:space="preserve">Allocates @block_size bytes of memory, and adds reference
+counting semantics to it.
+
+The contents of the returned data is set to zero.
+
+The data will be freed when its reference count drops to
+zero.</doc>
+ <return-value transfer-ownership="full">
+ <doc xml:space="preserve">a pointer to the allocated memory</doc>
+ <type name="gpointer" c:type="gpointer"/>
+ </return-value>
+ <parameters>
+ <parameter name="block_size" transfer-ownership="none">
+ <doc xml:space="preserve">the size of the allocation, must be greater than 0</doc>
+ <type name="gsize" c:type="gsize"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="rc_box_dup" c:identifier="g_rc_box_dup" version="2.58">
+ <doc xml:space="preserve">Allocates a new block of data with reference counting
+semantics, and copies @block_size bytes of @mem_block
+into it.</doc>
+ <return-value transfer-ownership="full">
+ <doc xml:space="preserve">a pointer to the allocated
+ memory</doc>
+ <type name="gpointer" c:type="gpointer"/>
+ </return-value>
+ <parameters>
+ <parameter name="block_size" transfer-ownership="none">
+ <doc xml:space="preserve">the number of bytes to copy, must be greater than 0</doc>
+ <type name="gsize" c:type="gsize"/>
+ </parameter>
+ <parameter name="mem_block" transfer-ownership="none">
+ <doc xml:space="preserve">the memory to copy</doc>
+ <type name="gpointer" c:type="gconstpointer"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="rc_box_get_size" c:identifier="g_rc_box_get_size" version="2.58">
+ <doc xml:space="preserve">Retrieves the size of the reference counted data pointed by @mem_block.</doc>
+ <return-value transfer-ownership="none">
+ <doc xml:space="preserve">the size of the data, in bytes</doc>
+ <type name="gsize" c:type="gsize"/>
+ </return-value>
+ <parameters>
+ <parameter name="mem_block" transfer-ownership="none">
+ <doc xml:space="preserve">a pointer to reference counted data</doc>
+ <type name="gpointer" c:type="gpointer"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="rc_box_release" c:identifier="g_rc_box_release" version="2.58">
+ <doc xml:space="preserve">Releases a reference on the data pointed by @mem_block.
+
+If the reference was the last one, it will free the
+resources allocated for @mem_block.</doc>
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+ <parameters>
+ <parameter name="mem_block" transfer-ownership="full">
+ <doc xml:space="preserve">a pointer to reference counted data</doc>
+ <type name="gpointer" c:type="gpointer"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="rc_box_release_full" c:identifier="g_rc_box_release_full" version="2.58">
+ <doc xml:space="preserve">Releases a reference on the data pointed by @mem_block.
+
+If the reference was the last one, it will call @clear_func
+to clear the contents of @mem_block, and then will free the
+resources allocated for @mem_block.</doc>
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+ <parameters>
+ <parameter name="mem_block" transfer-ownership="full">
+ <doc xml:space="preserve">a pointer to reference counted data</doc>
+ <type name="gpointer" c:type="gpointer"/>
+ </parameter>
+ <parameter name="clear_func" transfer-ownership="none" scope="async">
+ <doc xml:space="preserve">a function to call when clearing the data</doc>
+ <type name="DestroyNotify" c:type="GDestroyNotify"/>
+ </parameter>
+ </parameters>
+ </function>
<function name="realloc" c:identifier="g_realloc">
<doc xml:space="preserve">Reallocates the memory pointed to by @mem, so that it now has space for
@n_bytes bytes of memory. It returns the new address of the memory, which may
</parameter>
</parameters>
</function>
+ <function name="ref_count_compare" c:identifier="g_ref_count_compare" version="2.58">
+ <doc xml:space="preserve">Compares the current value of @rc with @val.</doc>
+ <return-value transfer-ownership="none">
+ <doc xml:space="preserve">%TRUE if the reference count is the same
+ as the given value</doc>
+ <type name="gboolean" c:type="gboolean"/>
+ </return-value>
+ <parameters>
+ <parameter name="rc" transfer-ownership="none">
+ <doc xml:space="preserve">the address of a reference count variable</doc>
+ <type name="gint" c:type="grefcount*"/>
+ </parameter>
+ <parameter name="val" transfer-ownership="none">
+ <doc xml:space="preserve">the value to compare</doc>
+ <type name="gint" c:type="gint"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="ref_count_dec" c:identifier="g_ref_count_dec" version="2.58">
+ <doc xml:space="preserve">Decreases the reference count.</doc>
+ <return-value transfer-ownership="none">
+ <doc xml:space="preserve">%TRUE if the reference count reached 0, and %FALSE otherwise</doc>
+ <type name="gboolean" c:type="gboolean"/>
+ </return-value>
+ <parameters>
+ <parameter name="rc" transfer-ownership="none">
+ <doc xml:space="preserve">the address of a reference count variable</doc>
+ <type name="gint" c:type="grefcount*"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="ref_count_inc" c:identifier="g_ref_count_inc" version="2.58">
+ <doc xml:space="preserve">Increases the reference count.</doc>
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+ <parameters>
+ <parameter name="rc" transfer-ownership="none">
+ <doc xml:space="preserve">the address of a reference count variable</doc>
+ <type name="gint" c:type="grefcount*"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="ref_count_init" c:identifier="g_ref_count_init" version="2.58">
+ <doc xml:space="preserve">Initializes a reference count variable.</doc>
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+ <parameters>
+ <parameter name="rc" transfer-ownership="none">
+ <doc xml:space="preserve">the address of a reference count variable</doc>
+ <type name="gint" c:type="grefcount*"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="ref_string_acquire" c:identifier="g_ref_string_acquire" version="2.58">
+ <doc xml:space="preserve">Acquires a reference on a string.</doc>
+ <return-value transfer-ownership="full">
+ <doc xml:space="preserve">the given string, with its reference count increased</doc>
+ <type name="utf8" c:type="char*"/>
+ </return-value>
+ <parameters>
+ <parameter name="str" transfer-ownership="none">
+ <doc xml:space="preserve">a reference counted string</doc>
+ <type name="utf8" c:type="char*"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="ref_string_length" c:identifier="g_ref_string_length" version="2.58">
+ <doc xml:space="preserve">Retrieves the length of @str.</doc>
+ <return-value transfer-ownership="none">
+ <doc xml:space="preserve">the length of the given string, in bytes</doc>
+ <type name="gsize" c:type="gsize"/>
+ </return-value>
+ <parameters>
+ <parameter name="str" transfer-ownership="none">
+ <doc xml:space="preserve">a reference counted string</doc>
+ <type name="utf8" c:type="char*"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="ref_string_new" c:identifier="g_ref_string_new" version="2.58">
+ <doc xml:space="preserve">Creates a new reference counted string and copies the contents of @str
+into it.</doc>
+ <return-value transfer-ownership="full">
+ <doc xml:space="preserve">the newly created reference counted string</doc>
+ <type name="utf8" c:type="char*"/>
+ </return-value>
+ <parameters>
+ <parameter name="str" transfer-ownership="none">
+ <doc xml:space="preserve">a NUL-terminated string</doc>
+ <type name="utf8" c:type="const char*"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="ref_string_new_intern" c:identifier="g_ref_string_new_intern" version="2.58">
+ <doc xml:space="preserve">Creates a new reference counted string and copies the content of @str
+into it.
+
+If you call this function multiple times with the same @str, or with
+the same contents of @str, it will return a new reference, instead of
+creating a new string.</doc>
+ <return-value transfer-ownership="full">
+ <doc xml:space="preserve">the newly created reference
+ counted string, or a new reference to an existing string</doc>
+ <type name="utf8" c:type="char*"/>
+ </return-value>
+ <parameters>
+ <parameter name="str" transfer-ownership="none">
+ <doc xml:space="preserve">a NUL-terminated string</doc>
+ <type name="utf8" c:type="const char*"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="ref_string_new_len" c:identifier="g_ref_string_new_len" version="2.58">
+ <doc xml:space="preserve">Creates a new reference counted string and copies the contents of @str
+into it, up to @len bytes.
+
+Since this function does not stop at nul bytes, it is the caller's
+responsibility to ensure that @str has at least @len addressable bytes.</doc>
+ <return-value transfer-ownership="full">
+ <doc xml:space="preserve">the newly created reference counted string</doc>
+ <type name="utf8" c:type="char*"/>
+ </return-value>
+ <parameters>
+ <parameter name="str" transfer-ownership="none">
+ <doc xml:space="preserve">a string</doc>
+ <type name="utf8" c:type="const char*"/>
+ </parameter>
+ <parameter name="len" transfer-ownership="none">
+ <doc xml:space="preserve">length of @str to use, or -1 if @str is nul-terminated</doc>
+ <type name="gssize" c:type="gssize"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="ref_string_release" c:identifier="g_ref_string_release" version="2.58">
+ <doc xml:space="preserve">Releases a reference on a string; if it was the last reference, the
+resources allocated by the string are freed as well.</doc>
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+ <parameters>
+ <parameter name="str" transfer-ownership="none">
+ <doc xml:space="preserve">a reference counted string</doc>
+ <type name="utf8" c:type="char*"/>
+ </parameter>
+ </parameters>
+ </function>
<function name="regex_check_replacement" c:identifier="g_regex_check_replacement" moved-to="Regex.check_replacement" version="2.14" throws="1">
<doc xml:space="preserve">Checks whether @replacement is a valid replacement string
(see g_regex_replace()), i.e. that all escape sequences in
<parameters>
<parameter name="string" transfer-ownership="none">
<doc xml:space="preserve">the string to escape</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
+ <array length="1" zero-terminated="0" c:type="const gchar*">
<type name="utf8" c:type="gchar"/>
</array>
</parameter>
<parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">the length of @string, or -1 if @string is nul-terminated</doc>
+ <doc xml:space="preserve">the length of @string, in bytes, or -1 if @string is nul-terminated</doc>
<type name="gint" c:type="gint"/>
</parameter>
</parameters>
</parameters>
</function>
<function name="sequence_move_range" c:identifier="g_sequence_move_range" moved-to="Sequence.move_range" version="2.14">
- <doc xml:space="preserve">Inserts the (@begin, @end) range at the destination pointed to by ptr.
+ <doc xml:space="preserve">Inserts the (@begin, @end) range at the destination pointed to by @dest.
The @begin and @end iters must point into the same sequence. It is
allowed for @dest to point to a different sequence than the one pointed
into by @begin and @end.
-If @dest is NULL, the range indicated by @begin and @end is
-removed from the sequence. If @dest iter points to a place within
+If @dest is %NULL, the range indicated by @begin and @end is
+removed from the sequence. If @dest points to a place within
the (@begin, @end) range, the range does not move.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</parameter>
</parameters>
</function>
+ <function name="spawn_async_with_fds" c:identifier="g_spawn_async_with_fds" version="2.58" throws="1">
+ <doc xml:space="preserve">Identical to g_spawn_async_with_pipes() but instead of
+creating pipes for the stdin/stdout/stderr, you can pass existing
+file descriptors into this function through the @stdin_fd,
+@stdout_fd and @stderr_fd parameters. The following @flags
+also have their behaviour slightly tweaked as a result:
+
+%G_SPAWN_STDOUT_TO_DEV_NULL means that the child's standard output
+will be discarded, instead of going to the same location as the parent's
+standard output. If you use this flag, @standard_output must be -1.
+%G_SPAWN_STDERR_TO_DEV_NULL means that the child's standard error
+will be discarded, instead of going to the same location as the parent's
+standard error. If you use this flag, @standard_error must be -1.
+%G_SPAWN_CHILD_INHERITS_STDIN means that the child will inherit the parent's
+standard input (by default, the child's standard input is attached to
+/dev/null). If you use this flag, @standard_input must be -1.
+
+It is valid to pass the same fd in multiple parameters (e.g. you can pass
+a single fd for both stdout and stderr).</doc>
+ <return-value transfer-ownership="none">
+ <doc xml:space="preserve">%TRUE on success, %FALSE if an error was set</doc>
+ <type name="gboolean" c:type="gboolean"/>
+ </return-value>
+ <parameters>
+ <parameter name="working_directory" transfer-ownership="none" nullable="1" allow-none="1">
+ <doc xml:space="preserve">child's current working directory, or %NULL to inherit parent's, in the GLib file name encoding</doc>
+ <type name="filename" c:type="const gchar*"/>
+ </parameter>
+ <parameter name="argv" transfer-ownership="none">
+ <doc xml:space="preserve">child's argument vector, in the GLib file name encoding</doc>
+ <array c:type="gchar**">
+ <type name="utf8" c:type="gchar*"/>
+ </array>
+ </parameter>
+ <parameter name="envp" transfer-ownership="none" nullable="1" allow-none="1">
+ <doc xml:space="preserve">child's environment, or %NULL to inherit parent's, in the GLib file name encoding</doc>
+ <array c:type="gchar**">
+ <type name="utf8" c:type="gchar*"/>
+ </array>
+ </parameter>
+ <parameter name="flags" transfer-ownership="none">
+ <doc xml:space="preserve">flags from #GSpawnFlags</doc>
+ <type name="SpawnFlags" c:type="GSpawnFlags"/>
+ </parameter>
+ <parameter name="child_setup" transfer-ownership="none" nullable="1" allow-none="1" scope="async" closure="5">
+ <doc xml:space="preserve">function to run in the child just before exec()</doc>
+ <type name="SpawnChildSetupFunc" c:type="GSpawnChildSetupFunc"/>
+ </parameter>
+ <parameter name="user_data" transfer-ownership="none" nullable="1" allow-none="1">
+ <doc xml:space="preserve">user data for @child_setup</doc>
+ <type name="gpointer" c:type="gpointer"/>
+ </parameter>
+ <parameter name="child_pid" direction="out" caller-allocates="0" transfer-ownership="full" optional="1" allow-none="1">
+ <doc xml:space="preserve">return location for child process ID, or %NULL</doc>
+ <type name="Pid" c:type="GPid*"/>
+ </parameter>
+ <parameter name="stdin_fd" transfer-ownership="none">
+ <doc xml:space="preserve">file descriptor to use for child's stdin, or -1</doc>
+ <type name="gint" c:type="gint"/>
+ </parameter>
+ <parameter name="stdout_fd" transfer-ownership="none">
+ <doc xml:space="preserve">file descriptor to use for child's stdout, or -1</doc>
+ <type name="gint" c:type="gint"/>
+ </parameter>
+ <parameter name="stderr_fd" transfer-ownership="none">
+ <doc xml:space="preserve">file descriptor to use for child's stderr, or -1</doc>
+ <type name="gint" c:type="gint"/>
+ </parameter>
+ </parameters>
+ </function>
<function name="spawn_async_with_pipes" c:identifier="g_spawn_async_with_pipes" throws="1">
<doc xml:space="preserve">Executes a child program asynchronously (your program will not
block waiting for the child to exit). The child program is
is equivalent to calling CloseHandle() on the process handle returned
in @child_pid). See g_child_watch_add().
-%G_SPAWN_LEAVE_DESCRIPTORS_OPEN means that the parent's open file
-descriptors will be inherited by the child; otherwise all descriptors
-except stdin/stdout/stderr will be closed before calling exec() in
-the child. %G_SPAWN_SEARCH_PATH means that @argv[0] need not be an
+Open UNIX file descriptors marked as `FD_CLOEXEC` will be automatically
+closed in the child process. %G_SPAWN_LEAVE_DESCRIPTORS_OPEN means that
+other open file descriptors will be inherited by the child; otherwise all
+descriptors except stdin/stdout/stderr will be closed before calling exec()
+in the child. %G_SPAWN_SEARCH_PATH means that @argv[0] need not be an
absolute path, it will be looked for in the `PATH` environment
variable. %G_SPAWN_SEARCH_PATH_FROM_ENVP means need not be an
absolute path, it will be looked for in the `PATH` variable from
If @child_pid is not %NULL and an error does not occur then the returned
process reference must be closed using g_spawn_close_pid().
+On modern UNIX platforms, GLib can use an efficient process launching
+codepath driven internally by posix_spawn(). This has the advantage of
+avoiding the fork-time performance costs of cloning the parent process
+address space, and avoiding associated memory overcommit checks that are
+not relevant in the context of immediately executing a distinct process.
+This optimized codepath will be used provided that the following conditions
+are met:
+
+1. %G_SPAWN_DO_NOT_REAP_CHILD is set
+2. %G_SPAWN_LEAVE_DESCRIPTORS_OPEN is set
+3. %G_SPAWN_SEARCH_PATH_FROM_ENVP is not set
+4. @working_directory is %NULL
+5. @child_setup is %NULL
+6. The program is of a recognised binary format, or has a shebang. Otherwise, GLib will have to execute the program through the shell, which is not done using the optimized codepath.
+
If you are writing a GTK+ application, and the program you are spawning is a
graphical application too, then to ensure that the spawned program opens its
windows on the right screen, you may want to use #GdkAppLaunchContext,
@key_equal_func parameter, when using non-%NULL strings as keys in a
#GHashTable.
-Note that this function is primarily meant as a hash table comparison
-function. For a general-purpose, %NULL-safe string comparison function,
-see g_strcmp0().</doc>
+This function is typically used for hash table comparisons, but can be used
+for general purpose comparisons of non-%NULL strings. For a %NULL-safe string
+comparison function, see g_strcmp0().</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE if the two keys match</doc>
<type name="gboolean" c:type="gboolean"/>
If the source language of @str is known, it can used to improve the
accuracy of the translation by passing it as @from_locale. It should
be a valid POSIX locale string (of the form
-"language[_territory][.codeset][@modifier]").
+`language[_territory][.codeset][@modifier]`).
If @from_locale is %NULL then the current locale is used.
If you want to do translation for no specific locale, and you want it
-to be done independently of the currently locale, specify "C" for
+to be done independently of the currently locale, specify `"C"` for
@from_locale.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">a string in plain ASCII</doc>
</function>
<function name="strv_length" c:identifier="g_strv_length" version="2.6">
<doc xml:space="preserve">Returns the length of the given %NULL-terminated
-string array @str_array.</doc>
+string array @str_array. @str_array must not be %NULL.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">length of @str_array.</doc>
<type name="guint" c:type="guint"/>
`no-undefined`: Avoid tests for undefined behaviour
-- `--debug-log`: Debug test logging output.</doc>
+- `--debug-log`: Debug test logging output.
+
+Since 2.58, if tests are compiled with `G_DISABLE_ASSERT` defined,
+g_test_init() will print an error and exit. This is to prevent no-op tests
+from being executed, as g_assert() is commonly (erroneously) used in unit
+tests, and is a no-op when compiled with `G_DISABLE_ASSERT`. Ensure your
+tests are compiled without `G_DISABLE_ASSERT` defined.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
particular code runs before or after a given test case, use
g_test_add(), which lets you specify setup and teardown functions.
-If all tests are skipped, this function will return 0 if
-producing TAP output, or 77 (treated as "skip test" by Automake) otherwise.</doc>
+If all tests are skipped or marked as incomplete (expected failures),
+this function will return 0 if producing TAP output, or 77 (treated
+as "skip test" by Automake) otherwise.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">0 on success, 1 on failure (assuming it returns at all),
- 0 or 77 if all tests were skipped with g_test_skip()</doc>
+ 0 or 77 if all tests were skipped with g_test_skip() and/or
+ g_test_incomplete()</doc>
<type name="gint" c:type="int"/>
</return-value>
</function>
@iso_date must include year, month, day, hours, minutes, and
seconds. It can optionally include fractions of a second and a time
zone indicator. (In the absence of any time zone indication, the
-timestamp is assumed to be in local time.)</doc>
+timestamp is assumed to be in local time.)
+
+Any leading or trailing space in @iso_date is ignored.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE if the conversion was successful.</doc>
<type name="gboolean" c:type="gboolean"/>
context. You can do these steps manually if you need greater control or to
use a custom main context.
-The interval given in terms of monotonic time, not wall clock time.
+The interval given is in terms of monotonic time, not wall clock time.
See g_get_monotonic_time().</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">the ID (greater than 0) of the event source.</doc>
The scheduling granularity/accuracy of this timeout source will be
in seconds.
-The interval given in terms of monotonic time, not wall clock time.
+The interval given is in terms of monotonic time, not wall clock time.
See g_get_monotonic_time().</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">the newly-created timeout source</doc>
<parameters>
<parameter name="str" transfer-ownership="none">
<doc xml:space="preserve">a pointer to character data</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
+ <array length="1" zero-terminated="0" c:type="const gchar*">
<type name="guint8"/>
</array>
</parameter>
should ensure that a string is a valid D-Bus object path before
passing it to g_variant_new_object_path().
-A valid object path starts with '/' followed by zero or more
-sequences of characters separated by '/' characters. Each sequence
-must contain only the characters "[A-Z][a-z][0-9]_". No sequence
-(including the one following the final '/' character) may be empty.</doc>
+A valid object path starts with `/` followed by zero or more
+sequences of characters separated by `/` characters. Each sequence
+must contain only the characters `[A-Z][a-z][0-9]_`. No sequence
+(including the one following the final `/` character) may be empty.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE if @string is a D-Bus object path</doc>
<type name="gboolean" c:type="gboolean"/>
<parameter name="entries" transfer-ownership="none">
<doc xml:space="preserve">a pointer to
the first item in an array of #GActionEntry structs</doc>
- <array length="1" zero-terminated="0" c:type="GActionEntry*">
+ <array length="1" zero-terminated="0" c:type="const GActionEntry*">
<type name="ActionEntry"/>
</array>
</parameter>
<return-value transfer-ownership="none">
<doc xml:space="preserve">
a list of content types.</doc>
- <array c:type="char**">
+ <array c:type="const char**">
<type name="utf8"/>
</array>
</return-value>
<return-value transfer-ownership="none">
<doc xml:space="preserve">
a list of content types.</doc>
- <array c:type="char**">
+ <array c:type="const char**">
<type name="utf8"/>
</array>
</return-value>
<return-value transfer-ownership="none">
<doc xml:space="preserve">
a list of content types.</doc>
- <array c:type="char**">
+ <array c:type="const char**">
<type name="utf8"/>
</array>
</return-value>
<parameter name="entries" transfer-ownership="none">
<doc xml:space="preserve">a
%NULL-terminated list of #GOptionEntrys</doc>
- <array c:type="GOptionEntry*">
+ <array c:type="const GOptionEntry*">
<type name="GLib.OptionEntry"/>
</array>
</parameter>
<return-value transfer-ownership="none">
<doc xml:space="preserve">
the environment strings, or %NULL if they were not sent</doc>
- <array c:type="gchar**">
+ <array c:type="const gchar* const*">
<type name="filename"/>
</array>
</return-value>
<member name="anonymous_supported" value="16" c:identifier="G_ASK_PASSWORD_ANONYMOUS_SUPPORTED" glib:nick="anonymous-supported">
<doc xml:space="preserve">operation supports anonymous users.</doc>
</member>
+ <member name="tcrypt" value="32" c:identifier="G_ASK_PASSWORD_TCRYPT" glib:nick="tcrypt">
+ <doc xml:space="preserve">operation takes TCRYPT parameters (Since: 2.58)</doc>
+ </member>
</bitfield>
<interface name="AsyncInitable" c:symbol-prefix="async_initable" c:type="GAsyncInitable" version="2.22" glib:type-name="GAsyncInitable" glib:get-type="g_async_initable_get_type" glib:type-struct="AsyncInitableIface">
<doc xml:space="preserve">This is the asynchronous version of #GInitable; it behaves the same
dispatched anywhere else - not even the standard dispatch machinery
(that API such as g_dbus_connection_signal_subscribe() and
g_dbus_connection_send_message_with_reply() relies on) will see the
-message. Similary, if a filter consumes an outgoing message, the
+message. Similarly, if a filter consumes an outgoing message, the
message will not be sent to the other peer.
If @user_data_free_func is non-%NULL, it will be called (in the
</parameters>
</method>
<method name="close_sync" c:identifier="g_dbus_connection_close_sync" version="2.26" throws="1">
- <doc xml:space="preserve">Synchronously closees @connection. The calling thread is blocked
+ <doc xml:space="preserve">Synchronously closes @connection. The calling thread is blocked
until this is done. See g_dbus_connection_close() for the
asynchronous version of this method and more details about what it
does.</doc>
</parameter>
<parameter name="entries" transfer-ownership="none">
<doc xml:space="preserve">A pointer to @num_entries #GDBusErrorEntry struct items.</doc>
- <array length="3" zero-terminated="0" c:type="GDBusErrorEntry*">
+ <array length="3" zero-terminated="0" c:type="const GDBusErrorEntry*">
<type name="DBusErrorEntry" c:type="GDBusErrorEntry"/>
</array>
</parameter>
<constructor name="new_from_blob" c:identifier="g_dbus_message_new_from_blob" version="2.26" throws="1">
<doc xml:space="preserve">Creates a new #GDBusMessage from the data stored at @blob. The byte
order that the message was in can be retrieved using
-g_dbus_message_get_byte_order().</doc>
+g_dbus_message_get_byte_order().
+
+If the @blob cannot be parsed, contains invalid fields, or contains invalid
+headers, %G_IO_ERROR_INVALID_ARGUMENT will be returned.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">A new #GDBusMessage or %NULL if @error is set. Free with
g_object_unref().</doc>
</return-value>
<parameters>
<parameter name="blob" transfer-ownership="none">
- <doc xml:space="preserve">A blob represent a binary D-Bus message.</doc>
+ <doc xml:space="preserve">A blob representing a binary D-Bus message.</doc>
<array length="1" zero-terminated="0" c:type="guchar*">
<type name="guint8"/>
</array>
</return-value>
<parameters>
<parameter name="blob" transfer-ownership="none">
- <doc xml:space="preserve">A blob represent a binary D-Bus message.</doc>
+ <doc xml:space="preserve">A blob representing a binary D-Bus message.</doc>
<array length="1" zero-terminated="0" c:type="guchar*">
<type name="guint8"/>
</array>
</parameters>
</method>
<method name="get_header" c:identifier="g_dbus_message_get_header" version="2.26">
- <doc xml:space="preserve">Gets a header field on @message.</doc>
- <return-value transfer-ownership="full">
+ <doc xml:space="preserve">Gets a header field on @message.
+
+The caller is responsible for checking the type of the returned #GVariant
+matches what is expected.</doc>
+ <return-value transfer-ownership="none" nullable="1">
<doc xml:space="preserve">A #GVariant with the value if the header was found, %NULL
otherwise. Do not free, it is owned by @message.</doc>
<type name="GLib.Variant" c:type="GVariant*"/>
<type name="DBusProxy"/>
</parameter>
<parameter name="changed_properties" transfer-ownership="none">
- <doc xml:space="preserve">A #GVariant containing the properties that changed.</doc>
+ <doc xml:space="preserve">A #GVariant containing the properties that changed (type: `a{sv}`).</doc>
<type name="GLib.Variant"/>
</parameter>
<parameter name="invalidated_properties" transfer-ownership="none">
</return-value>
<parameters>
<parameter name="changed_properties" transfer-ownership="none">
- <doc xml:space="preserve">A #GVariant containing the properties that changed</doc>
+ <doc xml:space="preserve">A #GVariant containing the properties that changed (type: `a{sv}`)</doc>
<type name="GLib.Variant"/>
</parameter>
<parameter name="invalidated_properties" transfer-ownership="none">
[Extending GIO][extending-gio].</doc>
<type name="utf8" c:type="gchar*"/>
</constant>
+ <constant name="DRIVE_IDENTIFIER_KIND_UNIX_DEVICE" value="unix-device" c:type="G_DRIVE_IDENTIFIER_KIND_UNIX_DEVICE" version="2.58">
+ <doc xml:space="preserve">The string used to obtain a Unix device path with g_drive_get_identifier().</doc>
+ <type name="utf8" c:type="gchar*"/>
+ </constant>
<class name="DataInputStream" c:symbol-prefix="data_input_stream" c:type="GDataInputStream" parent="BufferedInputStream" glib:type-name="GDataInputStream" glib:get-type="g_data_input_stream_get_type" glib:type-struct="DataInputStreamClass">
<doc xml:space="preserve">Data input stream implements #GInputStream and includes functions for
reading structured data directly from a binary input stream.</doc>
[Menu Spec](http://standards.freedesktop.org/menu-spec/latest/)
(i.e. a desktop id of kde-foo.desktop will match
`/usr/share/applications/kde/foo.desktop`).</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GDesktopAppInfo, or %NULL if no desktop file with that id</doc>
+ <return-value transfer-ownership="full" nullable="1">
+ <doc xml:space="preserve">a new #GDesktopAppInfo, or %NULL if no desktop
+ file with that id exists.</doc>
<type name="DesktopAppInfo" c:type="GDesktopAppInfo*"/>
</return-value>
<parameters>
</constructor>
<constructor name="new_from_filename" c:identifier="g_desktop_app_info_new_from_filename">
<doc xml:space="preserve">Creates a new #GDesktopAppInfo.</doc>
- <return-value transfer-ownership="full">
+ <return-value transfer-ownership="full" nullable="1">
<doc xml:space="preserve">a new #GDesktopAppInfo or %NULL on error.</doc>
<type name="DesktopAppInfo" c:type="GDesktopAppInfo*"/>
</return-value>
</constructor>
<constructor name="new_from_keyfile" c:identifier="g_desktop_app_info_new_from_keyfile" version="2.18">
<doc xml:space="preserve">Creates a new #GDesktopAppInfo.</doc>
- <return-value transfer-ownership="full">
+ <return-value transfer-ownership="full" nullable="1">
<doc xml:space="preserve">a new #GDesktopAppInfo or %NULL on error.</doc>
<type name="DesktopAppInfo" c:type="GDesktopAppInfo*"/>
</return-value>
launch applications. Ordinary applications should use
g_app_info_launch_uris().
-If the application is launched via traditional UNIX fork()/exec()
-then @spawn_flags, @user_setup and @user_setup_data are used for the
-call to g_spawn_async(). Additionally, @pid_callback (with
-@pid_callback_data) will be called to inform about the PID of the
-created process.
+If the application is launched via GSpawn, then @spawn_flags, @user_setup
+and @user_setup_data are used for the call to g_spawn_async().
+Additionally, @pid_callback (with @pid_callback_data) will be called to
+inform about the PID of the created process. See g_spawn_async_with_pipes()
+for information on certain parameter conditions that can enable an
+optimized posix_spawn() codepath to be used.
If application launching occurs via some other mechanism (eg: D-Bus
activation) then @spawn_flags, @user_setup, @user_setup_data,
</parameter>
</parameters>
</method>
+ <method name="launch_uris_as_manager_with_fds" c:identifier="g_desktop_app_info_launch_uris_as_manager_with_fds" version="2.58" throws="1">
+ <doc xml:space="preserve">Equivalent to g_desktop_app_info_launch_uris_as_manager() but allows
+you to pass in file descriptors for the stdin, stdout and stderr streams
+of the launched process.
+
+If application launching occurs via some non-spawn mechanism (e.g. D-Bus
+activation) then @stdin_fd, @stdout_fd and @stderr_fd are ignored.</doc>
+ <return-value transfer-ownership="none">
+ <doc xml:space="preserve">%TRUE on successful launch, %FALSE otherwise.</doc>
+ <type name="gboolean" c:type="gboolean"/>
+ </return-value>
+ <parameters>
+ <instance-parameter name="appinfo" transfer-ownership="none">
+ <doc xml:space="preserve">a #GDesktopAppInfo</doc>
+ <type name="DesktopAppInfo" c:type="GDesktopAppInfo*"/>
+ </instance-parameter>
+ <parameter name="uris" transfer-ownership="none">
+ <doc xml:space="preserve">List of URIs</doc>
+ <type name="GLib.List" c:type="GList*">
+ <type name="utf8"/>
+ </type>
+ </parameter>
+ <parameter name="launch_context" transfer-ownership="none" nullable="1" allow-none="1">
+ <doc xml:space="preserve">a #GAppLaunchContext</doc>
+ <type name="AppLaunchContext" c:type="GAppLaunchContext*"/>
+ </parameter>
+ <parameter name="spawn_flags" transfer-ownership="none">
+ <doc xml:space="preserve">#GSpawnFlags, used for each process</doc>
+ <type name="GLib.SpawnFlags" c:type="GSpawnFlags"/>
+ </parameter>
+ <parameter name="user_setup" transfer-ownership="none" nullable="1" allow-none="1" scope="async" closure="4">
+ <doc xml:space="preserve">a #GSpawnChildSetupFunc, used once
+ for each process.</doc>
+ <type name="GLib.SpawnChildSetupFunc" c:type="GSpawnChildSetupFunc"/>
+ </parameter>
+ <parameter name="user_setup_data" transfer-ownership="none" nullable="1" allow-none="1" closure="3">
+ <doc xml:space="preserve">User data for @user_setup</doc>
+ <type name="gpointer" c:type="gpointer"/>
+ </parameter>
+ <parameter name="pid_callback" transfer-ownership="none" nullable="1" allow-none="1" scope="call" closure="6">
+ <doc xml:space="preserve">Callback for child processes</doc>
+ <type name="DesktopAppLaunchCallback" c:type="GDesktopAppLaunchCallback"/>
+ </parameter>
+ <parameter name="pid_callback_data" transfer-ownership="none" nullable="1" allow-none="1" closure="5">
+ <doc xml:space="preserve">User data for @callback</doc>
+ <type name="gpointer" c:type="gpointer"/>
+ </parameter>
+ <parameter name="stdin_fd" transfer-ownership="none">
+ <doc xml:space="preserve">file descriptor to use for child's stdin, or -1</doc>
+ <type name="gint" c:type="gint"/>
+ </parameter>
+ <parameter name="stdout_fd" transfer-ownership="none">
+ <doc xml:space="preserve">file descriptor to use for child's stdout, or -1</doc>
+ <type name="gint" c:type="gint"/>
+ </parameter>
+ <parameter name="stderr_fd" transfer-ownership="none">
+ <doc xml:space="preserve">file descriptor to use for child's stderr, or -1</doc>
+ <type name="gint" c:type="gint"/>
+ </parameter>
+ </parameters>
+ </method>
<method name="list_actions" c:identifier="g_desktop_app_info_list_actions" version="2.38">
<doc xml:space="preserve">Returns the list of "additional application actions" supported on the
desktop file, as per the desktop file specification.
explicitly listed in the "Actions" key of the [Desktop Entry] group.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a list of strings, always non-%NULL</doc>
- <array c:type="gchar**">
+ <array c:type="const gchar* const*">
<type name="utf8"/>
</array>
</return-value>
</parameters>
</virtual-method>
<virtual-method name="get_identifier" invoker="get_identifier">
- <doc xml:space="preserve">Gets the identifier of the given kind for @drive.</doc>
- <return-value transfer-ownership="full">
+ <doc xml:space="preserve">Gets the identifier of the given kind for @drive. The only
+identifier currently available is
+#G_DRIVE_IDENTIFIER_KIND_UNIX_DEVICE.</doc>
+ <return-value transfer-ownership="full" nullable="1">
<doc xml:space="preserve">a newly allocated string containing the
- requested identfier, or %NULL if the #GDrive
+ requested identifier, or %NULL if the #GDrive
doesn't have this kind of identifier.</doc>
<type name="utf8" c:type="char*"/>
</return-value>
</virtual-method>
<virtual-method name="get_sort_key" invoker="get_sort_key" version="2.32">
<doc xml:space="preserve">Gets the sort key for @drive, if any.</doc>
- <return-value transfer-ownership="none">
+ <return-value transfer-ownership="none" nullable="1">
<doc xml:space="preserve">Sorting key for @drive or %NULL if no such key is available.</doc>
<type name="utf8" c:type="const gchar*"/>
</return-value>
</parameters>
</method>
<method name="get_identifier" c:identifier="g_drive_get_identifier">
- <doc xml:space="preserve">Gets the identifier of the given kind for @drive.</doc>
- <return-value transfer-ownership="full">
+ <doc xml:space="preserve">Gets the identifier of the given kind for @drive. The only
+identifier currently available is
+#G_DRIVE_IDENTIFIER_KIND_UNIX_DEVICE.</doc>
+ <return-value transfer-ownership="full" nullable="1">
<doc xml:space="preserve">a newly allocated string containing the
- requested identfier, or %NULL if the #GDrive
+ requested identifier, or %NULL if the #GDrive
doesn't have this kind of identifier.</doc>
<type name="utf8" c:type="char*"/>
</return-value>
</method>
<method name="get_sort_key" c:identifier="g_drive_get_sort_key" version="2.32">
<doc xml:space="preserve">Gets the sort key for @drive, if any.</doc>
- <return-value transfer-ownership="none">
+ <return-value transfer-ownership="none" nullable="1">
<doc xml:space="preserve">Sorting key for @drive or %NULL if no such key is available.</doc>
<type name="utf8" c:type="const gchar*"/>
</return-value>
</field>
<field name="get_identifier">
<callback name="get_identifier">
- <return-value transfer-ownership="full">
+ <return-value transfer-ownership="full" nullable="1">
<doc xml:space="preserve">a newly allocated string containing the
- requested identfier, or %NULL if the #GDrive
+ requested identifier, or %NULL if the #GDrive
doesn't have this kind of identifier.</doc>
<type name="utf8" c:type="char*"/>
</return-value>
</field>
<field name="get_sort_key">
<callback name="get_sort_key">
- <return-value transfer-ownership="none">
+ <return-value transfer-ownership="none" nullable="1">
<doc xml:space="preserve">Sorting key for @drive or %NULL if no such key is available.</doc>
<type name="utf8" c:type="const gchar*"/>
</return-value>
the free the list with g_list_free().</doc>
<type name="GLib.List" c:type="GList*">
<array name="GLib.ByteArray">
- <type name="gpointer" c:type="gpointer"/>
+ <type name="guint8" c:type="guint8"/>
</array>
</type>
</return-value>
<constant name="FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT" value="unix::is-mountpoint" c:type="G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT">
<doc xml:space="preserve">A key in the "unix" namespace for checking if the file represents a
UNIX mount point. This attribute is %TRUE if the file is a UNIX mount
-point. This attribute is only available for UNIX file systems.
+point. Since 2.58, `/` is considered to be a mount point.
+This attribute is only available for UNIX file systems.
Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.</doc>
<type name="utf8" c:type="gchar*"/>
</constant>
the actual file or directory represented by the #GFile; see
g_file_copy() if attempting to copy a file.
+g_file_dup() is useful when a second handle is needed to the same underlying
+file, for use in a separate thread (#GFile is not thread-safe). For use
+within the same thread, use g_object_ref() to increment the existing object’s
+reference count.
+
This call does no blocking I/O.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">a new #GFile that is a duplicate
<virtual-method name="is_native" invoker="is_native">
<doc xml:space="preserve">Checks to see if a file is native to the platform.
-A native file s one expressed in the platform-native filename format,
+A native file is one expressed in the platform-native filename format,
e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local,
as it might be on a locally mounted remote filesystem.
the actual file or directory represented by the #GFile; see
g_file_copy() if attempting to copy a file.
+g_file_dup() is useful when a second handle is needed to the same underlying
+file, for use in a separate thread (#GFile is not thread-safe). For use
+within the same thread, use g_object_ref() to increment the existing object’s
+reference count.
+
This call does no blocking I/O.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">a new #GFile that is a duplicate
<method name="is_native" c:identifier="g_file_is_native">
<doc xml:space="preserve">Checks to see if a file is native to the platform.
-A native file s one expressed in the platform-native filename format,
+A native file is one expressed in the platform-native filename format,
e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local,
as it might be on a locally mounted remote filesystem.
</instance-parameter>
<parameter name="contents" transfer-ownership="none">
<doc xml:space="preserve">a string containing the new contents for @file</doc>
- <array length="1" zero-terminated="0" c:type="char*">
+ <array length="1" zero-terminated="0" c:type="const char*">
<type name="guint8"/>
</array>
</parameter>
</instance-parameter>
<parameter name="contents" transfer-ownership="none">
<doc xml:space="preserve">string of contents to replace the file with</doc>
- <array length="1" zero-terminated="0" c:type="char*">
+ <array length="1" zero-terminated="0" c:type="const char*">
<type name="guint8"/>
</array>
</parameter>
</method>
<method name="set_attribute" c:identifier="g_file_info_set_attribute">
<doc xml:space="preserve">Sets the @attribute to contain the given value, if possible. To unset the
-attribute, use %G_ATTRIBUTE_TYPE_INVALID for @type.</doc>
+attribute, use %G_FILE_ATTRIBUTE_TYPE_INVALID for @type.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
native, the returned string is the result of g_file_get_uri()
(such as `sftp://path/to/my%20icon.png`).
-- If @icon is a #GThemedIcon with exactly one name, the encoding is
- simply the name (such as `network-server`).</doc>
+- If @icon is a #GThemedIcon with exactly one name and no fallbacks,
+ the encoding is simply the name (such as `network-server`).</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">An allocated NUL-terminated UTF8 string or
%NULL if @icon can't be serialized. Use g_free() to free.</doc>
native, the returned string is the result of g_file_get_uri()
(such as `sftp://path/to/my%20icon.png`).
-- If @icon is a #GThemedIcon with exactly one name, the encoding is
- simply the name (such as `network-server`).</doc>
+- If @icon is a #GThemedIcon with exactly one name and no fallbacks,
+ the encoding is simply the name (such as `network-server`).</doc>
<return-value transfer-ownership="full" nullable="1">
<doc xml:space="preserve">An allocated NUL-terminated UTF8 string or
%NULL if @icon can't be serialized. Use g_free() to free.</doc>
<parameters>
<parameter name="bytes" transfer-ownership="none">
<doc xml:space="preserve">raw address data</doc>
- <array zero-terminated="0" c:type="guint8*">
+ <array zero-terminated="0" c:type="const guint8*">
<type name="guint8"/>
</array>
</parameter>
This is a convenience method for getting the #GVolume and then
using that object to get the #GDrive.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a #GDrive or %NULL if @mount is not associated with a volume or a drive.
+ <return-value transfer-ownership="full" nullable="1">
+ <doc xml:space="preserve">a #GDrive or %NULL if @mount is not
+ associated with a volume or a drive.
The returned object should be unreffed with
g_object_unref() when no longer needed.</doc>
<type name="Drive" c:type="GDrive*"/>
</virtual-method>
<virtual-method name="get_sort_key" invoker="get_sort_key" version="2.32">
<doc xml:space="preserve">Gets the sort key for @mount, if any.</doc>
- <return-value transfer-ownership="none">
+ <return-value transfer-ownership="none" nullable="1">
<doc xml:space="preserve">Sorting key for @mount or %NULL if no such key is available.</doc>
<type name="utf8" c:type="const gchar*"/>
</return-value>
the file system UUID for the mount in question and should be
considered an opaque string. Returns %NULL if there is no UUID
available.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the UUID for @mount or %NULL if no UUID can be computed.
+ <return-value transfer-ownership="full" nullable="1">
+ <doc xml:space="preserve">the UUID for @mount or %NULL if no UUID
+ can be computed.
The returned string should be freed with g_free()
when no longer needed.</doc>
<type name="utf8" c:type="char*"/>
</virtual-method>
<virtual-method name="get_volume" invoker="get_volume">
<doc xml:space="preserve">Gets the volume for the @mount.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a #GVolume or %NULL if @mount is not associated with a volume.
+ <return-value transfer-ownership="full" nullable="1">
+ <doc xml:space="preserve">a #GVolume or %NULL if @mount is not
+ associated with a volume.
The returned object should be unreffed with
g_object_unref() when no longer needed.</doc>
<type name="Volume" c:type="GVolume*"/>
This is a convenience method for getting the #GVolume and then
using that object to get the #GDrive.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a #GDrive or %NULL if @mount is not associated with a volume or a drive.
+ <return-value transfer-ownership="full" nullable="1">
+ <doc xml:space="preserve">a #GDrive or %NULL if @mount is not
+ associated with a volume or a drive.
The returned object should be unreffed with
g_object_unref() when no longer needed.</doc>
<type name="Drive" c:type="GDrive*"/>
</method>
<method name="get_sort_key" c:identifier="g_mount_get_sort_key" version="2.32">
<doc xml:space="preserve">Gets the sort key for @mount, if any.</doc>
- <return-value transfer-ownership="none">
+ <return-value transfer-ownership="none" nullable="1">
<doc xml:space="preserve">Sorting key for @mount or %NULL if no such key is available.</doc>
<type name="utf8" c:type="const gchar*"/>
</return-value>
the file system UUID for the mount in question and should be
considered an opaque string. Returns %NULL if there is no UUID
available.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the UUID for @mount or %NULL if no UUID can be computed.
+ <return-value transfer-ownership="full" nullable="1">
+ <doc xml:space="preserve">the UUID for @mount or %NULL if no UUID
+ can be computed.
The returned string should be freed with g_free()
when no longer needed.</doc>
<type name="utf8" c:type="char*"/>
</method>
<method name="get_volume" c:identifier="g_mount_get_volume">
<doc xml:space="preserve">Gets the volume for the @mount.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a #GVolume or %NULL if @mount is not associated with a volume.
+ <return-value transfer-ownership="full" nullable="1">
+ <doc xml:space="preserve">a #GVolume or %NULL if @mount is not
+ associated with a volume.
The returned object should be unreffed with
g_object_unref() when no longer needed.</doc>
<type name="Volume" c:type="GVolume*"/>
</field>
<field name="get_uuid">
<callback name="get_uuid">
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the UUID for @mount or %NULL if no UUID can be computed.
+ <return-value transfer-ownership="full" nullable="1">
+ <doc xml:space="preserve">the UUID for @mount or %NULL if no UUID
+ can be computed.
The returned string should be freed with g_free()
when no longer needed.</doc>
<type name="utf8" c:type="char*"/>
</field>
<field name="get_volume">
<callback name="get_volume">
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a #GVolume or %NULL if @mount is not associated with a volume.
+ <return-value transfer-ownership="full" nullable="1">
+ <doc xml:space="preserve">a #GVolume or %NULL if @mount is not
+ associated with a volume.
The returned object should be unreffed with
g_object_unref() when no longer needed.</doc>
<type name="Volume" c:type="GVolume*"/>
</field>
<field name="get_drive">
<callback name="get_drive">
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a #GDrive or %NULL if @mount is not associated with a volume or a drive.
+ <return-value transfer-ownership="full" nullable="1">
+ <doc xml:space="preserve">a #GDrive or %NULL if @mount is not
+ associated with a volume or a drive.
The returned object should be unreffed with
g_object_unref() when no longer needed.</doc>
<type name="Drive" c:type="GDrive*"/>
</field>
<field name="get_sort_key">
<callback name="get_sort_key">
- <return-value transfer-ownership="none">
+ <return-value transfer-ownership="none" nullable="1">
<doc xml:space="preserve">Sorting key for @mount or %NULL if no such key is available.</doc>
<type name="utf8" c:type="const gchar*"/>
</return-value>
various callbacks to show the required dialogs, such as
#GtkMountOperation. If no user interaction is desired (for example
when automounting filesystems at login time), usually %NULL can be
-passed, see each method taking a #GMountOperation for details.</doc>
+passed, see each method taking a #GMountOperation for details.
+
+The term ‘TCRYPT’ is used to mean ‘compatible with TrueCrypt and VeraCrypt’.
+[TrueCrypt](https://en.wikipedia.org/wiki/TrueCrypt) is a discontinued system for
+encrypting file containers, partitions or whole disks, typically used with Windows.
+[VeraCrypt](https://www.veracrypt.fr/) is a maintained fork of TrueCrypt with various
+improvements and auditing fixes.</doc>
<constructor name="new" c:identifier="g_mount_operation_new">
<doc xml:space="preserve">Creates a new mount operation.</doc>
<return-value transfer-ownership="full">
<type name="utf8" c:type="const char*"/>
</parameter>
<parameter name="choices" transfer-ownership="none">
- <array c:type="char*">
+ <array c:type="const char**">
<type name="utf8"/>
</array>
</parameter>
</array>
</parameter>
<parameter name="choices" transfer-ownership="none">
- <array c:type="gchar*">
+ <array c:type="const gchar**">
<type name="utf8"/>
</array>
</parameter>
</instance-parameter>
</parameters>
</method>
+ <method name="get_is_tcrypt_hidden_volume" c:identifier="g_mount_operation_get_is_tcrypt_hidden_volume" version="2.58">
+ <doc xml:space="preserve">Check to see whether the mount operation is being used
+for a TCRYPT hidden volume.</doc>
+ <return-value transfer-ownership="none">
+ <doc xml:space="preserve">%TRUE if mount operation is for hidden volume.</doc>
+ <type name="gboolean" c:type="gboolean"/>
+ </return-value>
+ <parameters>
+ <instance-parameter name="op" transfer-ownership="none">
+ <doc xml:space="preserve">a #GMountOperation.</doc>
+ <type name="MountOperation" c:type="GMountOperation*"/>
+ </instance-parameter>
+ </parameters>
+ </method>
+ <method name="get_is_tcrypt_system_volume" c:identifier="g_mount_operation_get_is_tcrypt_system_volume" version="2.58">
+ <doc xml:space="preserve">Check to see whether the mount operation is being used
+for a TCRYPT system volume.</doc>
+ <return-value transfer-ownership="none">
+ <doc xml:space="preserve">%TRUE if mount operation is for system volume.</doc>
+ <type name="gboolean" c:type="gboolean"/>
+ </return-value>
+ <parameters>
+ <instance-parameter name="op" transfer-ownership="none">
+ <doc xml:space="preserve">a #GMountOperation.</doc>
+ <type name="MountOperation" c:type="GMountOperation*"/>
+ </instance-parameter>
+ </parameters>
+ </method>
<method name="get_password" c:identifier="g_mount_operation_get_password">
<doc xml:space="preserve">Gets a password from the mount operation.</doc>
<return-value transfer-ownership="none">
</instance-parameter>
</parameters>
</method>
+ <method name="get_pim" c:identifier="g_mount_operation_get_pim" version="2.58">
+ <doc xml:space="preserve">Gets a PIM from the mount operation.</doc>
+ <return-value transfer-ownership="none">
+ <doc xml:space="preserve">The VeraCrypt PIM within @op.</doc>
+ <type name="guint" c:type="guint"/>
+ </return-value>
+ <parameters>
+ <instance-parameter name="op" transfer-ownership="none">
+ <doc xml:space="preserve">a #GMountOperation.</doc>
+ <type name="MountOperation" c:type="GMountOperation*"/>
+ </instance-parameter>
+ </parameters>
+ </method>
<method name="get_username" c:identifier="g_mount_operation_get_username">
<doc xml:space="preserve">Get the user name from the mount operation.</doc>
<return-value transfer-ownership="none">
</parameter>
</parameters>
</method>
+ <method name="set_is_tcrypt_hidden_volume" c:identifier="g_mount_operation_set_is_tcrypt_hidden_volume" version="2.58">
+ <doc xml:space="preserve">Sets the mount operation to use a hidden volume if @hidden_volume is %TRUE.</doc>
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+ <parameters>
+ <instance-parameter name="op" transfer-ownership="none">
+ <doc xml:space="preserve">a #GMountOperation.</doc>
+ <type name="MountOperation" c:type="GMountOperation*"/>
+ </instance-parameter>
+ <parameter name="hidden_volume" transfer-ownership="none">
+ <doc xml:space="preserve">boolean value.</doc>
+ <type name="gboolean" c:type="gboolean"/>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="set_is_tcrypt_system_volume" c:identifier="g_mount_operation_set_is_tcrypt_system_volume" version="2.58">
+ <doc xml:space="preserve">Sets the mount operation to use a system volume if @system_volume is %TRUE.</doc>
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+ <parameters>
+ <instance-parameter name="op" transfer-ownership="none">
+ <doc xml:space="preserve">a #GMountOperation.</doc>
+ <type name="MountOperation" c:type="GMountOperation*"/>
+ </instance-parameter>
+ <parameter name="system_volume" transfer-ownership="none">
+ <doc xml:space="preserve">boolean value.</doc>
+ <type name="gboolean" c:type="gboolean"/>
+ </parameter>
+ </parameters>
+ </method>
<method name="set_password" c:identifier="g_mount_operation_set_password">
<doc xml:space="preserve">Sets the mount operation's password to @password.</doc>
<return-value transfer-ownership="none">
</parameter>
</parameters>
</method>
+ <method name="set_pim" c:identifier="g_mount_operation_set_pim" version="2.58">
+ <doc xml:space="preserve">Sets the mount operation's PIM to @pim.</doc>
+ <return-value transfer-ownership="none">
+ <type name="none" c:type="void"/>
+ </return-value>
+ <parameters>
+ <instance-parameter name="op" transfer-ownership="none">
+ <doc xml:space="preserve">a #GMountOperation.</doc>
+ <type name="MountOperation" c:type="GMountOperation*"/>
+ </instance-parameter>
+ <parameter name="pim" transfer-ownership="none">
+ <doc xml:space="preserve">an unsigned integer.</doc>
+ <type name="guint" c:type="guint"/>
+ </parameter>
+ </parameters>
+ </method>
<method name="set_username" c:identifier="g_mount_operation_set_username">
<doc xml:space="preserve">Sets the user name within @op to @username.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">The domain to use for the mount operation.</doc>
<type name="utf8" c:type="gchar*"/>
</property>
+ <property name="is-tcrypt-hidden-volume" version="2.58" writable="1" transfer-ownership="none">
+ <doc xml:space="preserve">Whether the device to be unlocked is a TCRYPT hidden volume.
+See https://www.veracrypt.fr/en/Hidden%20Volume.html.</doc>
+ <type name="gboolean" c:type="gboolean"/>
+ </property>
+ <property name="is-tcrypt-system-volume" version="2.58" writable="1" transfer-ownership="none">
+ <doc xml:space="preserve">Whether the device to be unlocked is a TCRYPT system volume.
+In this context, a system volume is a volume with a bootloader
+and operating system installed. This is only supported for Windows
+operating systems. For further documentation, see
+https://www.veracrypt.fr/en/System%20Encryption.html.</doc>
+ <type name="gboolean" c:type="gboolean"/>
+ </property>
<property name="password" writable="1" transfer-ownership="none">
<doc xml:space="preserve">The password that is used for authentication when carrying out
the mount operation.</doc>
<doc xml:space="preserve">Determines if and how the password information should be saved.</doc>
<type name="PasswordSave"/>
</property>
+ <property name="pim" version="2.58" writable="1" transfer-ownership="none">
+ <doc xml:space="preserve">The VeraCrypt PIM value, when unlocking a VeraCrypt volume. See
+https://www.veracrypt.fr/en/Personal%20Iterations%20Multiplier%20(PIM).html.</doc>
+ <type name="guint" c:type="guint"/>
+ </property>
<property name="username" writable="1" transfer-ownership="none">
<doc xml:space="preserve">The user name that is used for authentication when carrying out
the mount operation.</doc>
<type name="utf8" c:type="const char*"/>
</parameter>
<parameter name="choices" transfer-ownership="none">
- <array c:type="char*">
+ <array c:type="const char**">
<type name="utf8"/>
</array>
</parameter>
</array>
</parameter>
<parameter name="choices" transfer-ownership="none">
- <array c:type="gchar*">
+ <array c:type="const gchar**">
<type name="utf8"/>
</array>
</parameter>
Note: @data must be backed by memory that is at least pointer aligned.
Otherwise this function will internally create a copy of the memory since
-GLib 2.56, or in older versions fail and exit the process.</doc>
+GLib 2.56, or in older versions fail and exit the process.
+
+If @data is empty or corrupt, %G_RESOURCE_ERROR_INTERNAL will be returned.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">a new #GResource, or %NULL on error</doc>
<type name="Resource" c:type="GResource*"/>
you to query it for data.
If you want to use this resource in the global resource namespace you need
-to register it with g_resources_register().</doc>
+to register it with g_resources_register().
+
+If @filename is empty or the data in it is corrupt,
+%G_RESOURCE_ERROR_INTERNAL will be returned. If @filename doesn’t exist, or
+there is an error in reading it, an error from g_mapped_file_new() will be
+returned.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">a new #GResource, or %NULL on error</doc>
<type name="Resource" c:type="GResource*"/>
to call g_settings_get_child().
For GSettings objects that are lists, this value can change at any
-time and you should connect to the "children-changed" signal to watch
-for those changes. Note that there is a race condition here: you may
+time. Note that there is a race condition here: you may
request a child after listing it only for it to have been destroyed
in the meantime. For this reason, g_settings_get_child() may return
%NULL even for a child that was listed by this function.
</parameter>
<parameter name="value" transfer-ownership="none" nullable="1" allow-none="1">
<doc xml:space="preserve">the value to set it to, or %NULL</doc>
- <array c:type="gchar**">
+ <array c:type="const gchar* const*">
<type name="utf8" c:type="gchar*"/>
</array>
</parameter>
<parameter name="keys" direction="out" caller-allocates="0" transfer-ownership="container">
<doc xml:space="preserve">the
location to save the relative keys</doc>
- <array c:type="gchar***">
+ <array c:type="const gchar***">
<type name="utf8" c:type="gchar**"/>
</array>
</parameter>
</parameter>
<parameter name="items" transfer-ownership="none">
<doc xml:space="preserve">the %NULL-terminated list of changed keys</doc>
- <array c:type="gchar**">
+ <array c:type="const gchar* const*">
<type name="utf8" c:type="gchar*"/>
</array>
</parameter>
Generally, you should set @trusted to %TRUE for files installed by the
system and to %FALSE for files in the home directory.
+In either case, an empty file or some types of corruption in the file will
+result in %G_FILE_ERROR_INVAL being returned.
+
If @parent is non-%NULL then there are two effects.
First, if g_settings_schema_source_lookup() is called with the
<constructor name="new" c:identifier="g_simple_action_new" version="2.28">
<doc xml:space="preserve">Creates a new action.
-The created action is stateless. See g_simple_action_new_stateful().</doc>
+The created action is stateless. See g_simple_action_new_stateful() to create
+an action that has state.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">a new #GSimpleAction</doc>
<type name="SimpleAction" c:type="GSimpleAction*"/>
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="parameter_type" transfer-ownership="none" nullable="1" allow-none="1">
- <doc xml:space="preserve">the type of parameter to the activate function</doc>
+ <doc xml:space="preserve">the type of parameter that will be passed to
+ handlers for the #GSimpleAction::activate signal, or %NULL for no parameter</doc>
<type name="GLib.VariantType" c:type="const GVariantType*"/>
</parameter>
</parameters>
<constructor name="new_stateful" c:identifier="g_simple_action_new_stateful" version="2.28">
<doc xml:space="preserve">Creates a new stateful action.
-@state is the initial state of the action. All future state values
-must have the same #GVariantType as the initial state.
+All future state values must have the same #GVariantType as the initial
+@state.
-If the @state GVariant is floating, it is consumed.</doc>
+If the @state #GVariant is floating, it is consumed.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">a new #GSimpleAction</doc>
<type name="SimpleAction" c:type="GSimpleAction*"/>
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="parameter_type" transfer-ownership="none" nullable="1" allow-none="1">
- <doc xml:space="preserve">the type of the parameter to the activate function</doc>
+ <doc xml:space="preserve">the type of the parameter that will be passed to
+ handlers for the #GSimpleAction::activate signal, or %NULL for no parameter</doc>
<type name="GLib.VariantType" c:type="const GVariantType*"/>
</parameter>
<parameter name="state" transfer-ownership="none">
<glib:signal name="activate" when="last" version="2.28">
<doc xml:space="preserve">Indicates that the action was just activated.
-@parameter will always be of the expected type. In the event that
-an incorrect type was given, no signal will be emitted.
+@parameter will always be of the expected type, i.e. the parameter type
+specified when the action was created. If an incorrect type is given when
+activating the action, this signal is not emitted.
Since GLib 2.40, if no handler is connected to this signal then the
default behaviour for boolean-stated actions with a %NULL parameter
</return-value>
<parameters>
<parameter name="parameter" transfer-ownership="none" nullable="1" allow-none="1">
- <doc xml:space="preserve">the parameter to the activation</doc>
+ <doc xml:space="preserve">the parameter to the activation, or %NULL if it has
+ no parameter</doc>
<type name="GLib.Variant"/>
</parameter>
</parameters>
<doc xml:space="preserve">Indicates that the action just received a request to change its
state.
-@value will always be of the correct state type. In the event that
-an incorrect type was given, no signal will be emitted.
+@value will always be of the correct state type, i.e. the type of the
+initial state passed to g_simple_action_new_stateful(). If an incorrect
+type is given when requesting to change the state, this signal is not
+emitted.
If no handler is connected to this signal then the default
behaviour is to call g_simple_action_set_state() to set the state
<parameter name="entries" transfer-ownership="none">
<doc xml:space="preserve">a pointer to the first item in
an array of #GActionEntry structs</doc>
- <array length="1" zero-terminated="0" c:type="GActionEntry*">
+ <array length="1" zero-terminated="0" c:type="const GActionEntry*">
<type name="ActionEntry" c:type="GActionEntry"/>
</array>
</parameter>
<parameter name="buffer" transfer-ownership="none">
<doc xml:space="preserve">the buffer
containing the data to send.</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
+ <array length="1" zero-terminated="0" c:type="const gchar*">
<type name="guint8"/>
</array>
</parameter>
<parameter name="buffer" transfer-ownership="none">
<doc xml:space="preserve">the buffer
containing the data to send.</doc>
- <array length="2" zero-terminated="0" c:type="gchar*">
+ <array length="2" zero-terminated="0" c:type="const gchar*">
<type name="guint8"/>
</array>
</parameter>
<parameter name="buffer" transfer-ownership="none">
<doc xml:space="preserve">the buffer
containing the data to send.</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
+ <array length="1" zero-terminated="0" c:type="const gchar*">
<type name="guint8"/>
</array>
</parameter>
of server sockets and helps you accept sockets from any of the
socket, either sync or async.
+Add addresses and ports to listen on using g_socket_listener_add_address()
+and g_socket_listener_add_inet_port(). These will be listened on until
+g_socket_listener_close() is called. Dropping your final reference to the
+#GSocketListener will not cause g_socket_listener_close() to be called
+implicitly, as some references to the #GSocketListener may be held
+internally.
+
If you want to implement a network server, also look at #GSocketService
-and #GThreadedSocketService which are subclass of #GSocketListener
-that makes this even easier.</doc>
+and #GThreadedSocketService which are subclasses of #GSocketListener
+that make this even easier.</doc>
<constructor name="new" c:identifier="g_socket_listener_new" version="2.22">
<doc xml:space="preserve">Creates a new #GSocketListener with no sockets to listen for.
New listeners can be added with e.g. g_socket_listener_add_address()
be set to the address that the binding actually occurred at. This
is helpful for determining the port number that was used for when
requesting a binding to port 0 (ie: "any port"). This address, if
-requested, belongs to the caller and must be freed.</doc>
+requested, belongs to the caller and must be freed.
+
+Call g_socket_listener_close() to stop listening on @address; this will not
+be done automatically when you drop your final reference to @listener, as
+references may be held internally.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE on success, %FALSE on error.</doc>
<type name="gboolean" c:type="gboolean"/>
@source_object will be passed out in the various calls
to accept to identify this particular source, which is
useful if you're listening on multiple addresses and do
-different things depending on what address is connected to.</doc>
+different things depending on what address is connected to.
+
+Call g_socket_listener_close() to stop listening on @port; this will not
+be done automatically when you drop your final reference to @listener, as
+references may be held internally.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE on success, %FALSE on error.</doc>
<type name="gboolean" c:type="gboolean"/>
<parameters>
<parameter name="argv" transfer-ownership="none">
<doc xml:space="preserve">commandline arguments for the subprocess</doc>
- <array c:type="gchar**">
+ <array c:type="const gchar* const*">
<type name="filename"/>
</array>
</parameter>
</instance-parameter>
<parameter name="argv" transfer-ownership="none">
<doc xml:space="preserve">Command line arguments</doc>
- <array c:type="gchar**">
+ <array c:type="const gchar* const*">
<type name="filename"/>
</array>
</parameter>
where it was created (waiting until the next iteration of the main
loop first, if necessary). The caller will pass the #GTask back to
the operation's finish function (as a #GAsyncResult), and you can
-can use g_task_propagate_pointer() or the like to extract the
+use g_task_propagate_pointer() or the like to extract the
return value.
Here is an example for using GTask as a GAsyncResult:
This property and the #GTlsCertificate:certificate-pem property
represent the same data, just in different forms.</doc>
<array name="GLib.ByteArray">
- <type name="gpointer" c:type="gpointer"/>
+ <type name="guint8" c:type="guint8"/>
</array>
</property>
<property name="certificate-pem" version="2.28" writable="1" construct-only="1" transfer-ownership="none">
support PKCS#1. You can use the `openssl rsa`
tool to convert PKCS#8 keys to PKCS#1.</doc>
<array name="GLib.ByteArray">
- <type name="gpointer" c:type="gpointer"/>
+ <type name="guint8" c:type="guint8"/>
</array>
</property>
<property name="private-key-pem" version="2.28" readable="0" writable="1" construct-only="1" transfer-ownership="none">
the free the list with g_list_free().</doc>
<type name="GLib.List" c:type="GList*">
<array name="GLib.ByteArray">
- <type name="gpointer" c:type="gpointer"/>
+ <type name="guint8" c:type="guint8"/>
</array>
</type>
</return-value>
</parameters>
</method>
<method name="set_use_ssl3" c:identifier="g_tls_client_connection_set_use_ssl3" version="2.28" deprecated="1" deprecated-version="2.56">
- <doc xml:space="preserve">If @use_ssl3 is %TRUE, this forces @conn to use the lowest-supported
-TLS protocol version rather than trying to properly negotiate the
-highest mutually-supported protocol version with the peer. This can
-be used when talking to broken TLS servers that exhibit protocol
-version intolerance.
-
-Be aware that SSL 3.0 is generally disabled by the #GTlsBackend, so
-the lowest-supported protocol version is probably not SSL 3.0.</doc>
+ <doc xml:space="preserve">Since 2.42.1, if @use_ssl3 is %TRUE, this forces @conn to use the
+lowest-supported TLS protocol version rather than trying to properly
+negotiate the highest mutually-supported protocol version with the
+peer. Be aware that SSL 3.0 is generally disabled by the
+#GTlsBackend, so the lowest-supported protocol version is probably
+not SSL 3.0.
+
+Since 2.58, this may additionally cause an RFC 7507 fallback SCSV to
+be sent to the server, causing modern TLS servers to immediately
+terminate the connection. You should generally only use this function
+if you need to connect to broken servers that exhibit TLS protocol
+version intolerance, and when an initial attempt to connect to a
+server normally has already failed.</doc>
<doc-deprecated xml:space="preserve">SSL 3.0 is insecure, and this function does not
generally enable or disable it, despite its name.</doc-deprecated>
<return-value transfer-ownership="none">
<property name="use-ssl3" version="2.28" deprecated="1" deprecated-version="2.56" writable="1" construct="1" transfer-ownership="none">
<doc xml:space="preserve">If %TRUE, forces the connection to use a fallback version of TLS
or SSL, rather than trying to negotiate the best version of TLS
-to use. This can be used when talking to servers that don't
-implement version negotiation correctly and therefore refuse to
-handshake at all with a modern TLS handshake.
-
-Despite the property name, the fallback version is usually not
-SSL 3.0, because SSL 3.0 is generally disabled by the #GTlsBackend.
-#GTlsClientConnection will use the next-highest available version
-as the fallback version.</doc>
+to use. See g_tls_client_connection_set_use_ssl3().</doc>
<doc-deprecated xml:space="preserve">SSL 3.0 is insecure, and this property does not
generally enable or disable it, despite its name.</doc-deprecated>
<type name="gboolean" c:type="gboolean"/>
the beginning of the communication, you do not need to call this
function explicitly unless you want clearer error reporting.
However, you may call g_tls_connection_handshake() later on to
-renegotiate parameters (encryption methods, etc) with the client.
+rehandshake, if TLS 1.2 or older is in use. With TLS 1.3, the
+behavior is undefined but guaranteed to be reasonable and
+nondestructive, so most older code should be expected to continue to
+work without changes.
#GTlsConnection::accept_certificate may be emitted during the
handshake.</doc>
the beginning of the communication, you do not need to call this
function explicitly unless you want clearer error reporting.
However, you may call g_tls_connection_handshake() later on to
-renegotiate parameters (encryption methods, etc) with the client.
+rehandshake, if TLS 1.2 or older is in use. With TLS 1.3, the
+behavior is undefined but guaranteed to be reasonable and
+nondestructive, so most older code should be expected to continue to
+work without changes.
#GTlsConnection::accept_certificate may be emitted during the
handshake.</doc>
</parameters>
</method>
<method name="set_rehandshake_mode" c:identifier="g_tls_connection_set_rehandshake_mode" version="2.28">
- <doc xml:space="preserve">Sets how @conn behaves with respect to rehandshaking requests.
+ <doc xml:space="preserve">Sets how @conn behaves with respect to rehandshaking requests, when
+TLS 1.2 or older is in use.
%G_TLS_REHANDSHAKE_NEVER means that it will never agree to
rehandshake after the initial handshake is complete. (For a client,
</instance-parameter>
<parameter name="value" transfer-ownership="none">
<doc xml:space="preserve">the new password value</doc>
- <array length="1" zero-terminated="0" c:type="guchar*">
+ <array length="1" zero-terminated="0" c:type="const guchar*">
<type name="guint8" c:type="guchar"/>
</array>
</parameter>
<parameters>
<parameter name="fds" transfer-ownership="none">
<doc xml:space="preserve">the initial list of file descriptors</doc>
- <array length="1" zero-terminated="0" c:type="gint*">
+ <array length="1" zero-terminated="0" c:type="const gint*">
<type name="gint" c:type="gint"/>
</array>
</parameter>
<return-value transfer-ownership="none">
<doc xml:space="preserve">an array of file
descriptors</doc>
- <array length="0" zero-terminated="0" c:type="gint*">
+ <array length="0" zero-terminated="0" c:type="const gint*">
<type name="gint" c:type="gint"/>
</array>
</return-value>
<parameters>
<parameter name="path" transfer-ownership="none">
<doc xml:space="preserve">the abstract name</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
+ <array length="1" zero-terminated="0" c:type="const gchar*">
<type name="gchar"/>
</array>
</parameter>
<parameters>
<parameter name="path" transfer-ownership="none">
<doc xml:space="preserve">the name</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
+ <array length="1" zero-terminated="0" c:type="const gchar*">
<type name="gchar"/>
</array>
</parameter>
</property>
<property name="path-as-array" writable="1" construct-only="1" transfer-ownership="none">
<array name="GLib.ByteArray">
- <type name="gpointer" c:type="gpointer"/>
+ <type name="guint8" c:type="guint8"/>
</array>
</property>
<field name="parent_instance">
a "Network" heading and `device` volumes under a "Devices" heading.</doc>
<type name="utf8" c:type="gchar*"/>
</constant>
- <constant name="VOLUME_IDENTIFIER_KIND_HAL_UDI" value="hal-udi" c:type="G_VOLUME_IDENTIFIER_KIND_HAL_UDI">
+ <constant name="VOLUME_IDENTIFIER_KIND_HAL_UDI" value="hal-udi" c:type="G_VOLUME_IDENTIFIER_KIND_HAL_UDI" deprecated="1" deprecated-version="2.58">
<doc xml:space="preserve">The string used to obtain a Hal UDI with g_volume_get_identifier().</doc>
+ <doc-deprecated xml:space="preserve">Do not use, HAL is deprecated.</doc-deprecated>
<type name="utf8" c:type="gchar*"/>
</constant>
<constant name="VOLUME_IDENTIFIER_KIND_LABEL" value="label" c:type="G_VOLUME_IDENTIFIER_KIND_LABEL">
different kinds of identifiers, such as Hal UDIs, filesystem labels,
traditional Unix devices (e.g. `/dev/sda2`), UUIDs. GIO uses predefined
strings as names for the different kinds of identifiers:
-#G_VOLUME_IDENTIFIER_KIND_HAL_UDI, #G_VOLUME_IDENTIFIER_KIND_LABEL, etc.
+#G_VOLUME_IDENTIFIER_KIND_UUID, #G_VOLUME_IDENTIFIER_KIND_LABEL, etc.
Use g_volume_get_identifier() to obtain an identifier for a volume.
</virtual-method>
<virtual-method name="get_drive" invoker="get_drive">
<doc xml:space="preserve">Gets the drive for the @volume.</doc>
- <return-value transfer-ownership="full">
+ <return-value transfer-ownership="full" nullable="1">
<doc xml:space="preserve">a #GDrive or %NULL if @volume is not
associated with a drive. The returned object should be unreffed
with g_object_unref() when no longer needed.</doc>
<doc xml:space="preserve">Gets the identifier of the given kind for @volume.
See the [introduction][volume-identifier] for more
information about volume identifiers.</doc>
- <return-value transfer-ownership="full">
+ <return-value transfer-ownership="full" nullable="1">
<doc xml:space="preserve">a newly allocated string containing the
- requested identfier, or %NULL if the #GVolume
+ requested identifier, or %NULL if the #GVolume
doesn't have this kind of identifier</doc>
<type name="utf8" c:type="char*"/>
</return-value>
</virtual-method>
<virtual-method name="get_mount" invoker="get_mount">
<doc xml:space="preserve">Gets the mount for the @volume.</doc>
- <return-value transfer-ownership="full">
+ <return-value transfer-ownership="full" nullable="1">
<doc xml:space="preserve">a #GMount or %NULL if @volume isn't mounted.
The returned object should be unreffed with g_object_unref()
when no longer needed.</doc>
</virtual-method>
<virtual-method name="get_sort_key" invoker="get_sort_key" version="2.32">
<doc xml:space="preserve">Gets the sort key for @volume, if any.</doc>
- <return-value transfer-ownership="none">
+ <return-value transfer-ownership="none" nullable="1">
<doc xml:space="preserve">Sorting key for @volume or %NULL if no such key is available</doc>
<type name="utf8" c:type="const gchar*"/>
</return-value>
the file system UUID for the volume in question and should be
considered an opaque string. Returns %NULL if there is no UUID
available.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the UUID for @volume or %NULL if no UUID can be computed.
+ <return-value transfer-ownership="full" nullable="1">
+ <doc xml:space="preserve">the UUID for @volume or %NULL if no UUID
+ can be computed.
The returned string should be freed with g_free()
when no longer needed.</doc>
<type name="utf8" c:type="char*"/>
</method>
<method name="get_drive" c:identifier="g_volume_get_drive">
<doc xml:space="preserve">Gets the drive for the @volume.</doc>
- <return-value transfer-ownership="full">
+ <return-value transfer-ownership="full" nullable="1">
<doc xml:space="preserve">a #GDrive or %NULL if @volume is not
associated with a drive. The returned object should be unreffed
with g_object_unref() when no longer needed.</doc>
<doc xml:space="preserve">Gets the identifier of the given kind for @volume.
See the [introduction][volume-identifier] for more
information about volume identifiers.</doc>
- <return-value transfer-ownership="full">
+ <return-value transfer-ownership="full" nullable="1">
<doc xml:space="preserve">a newly allocated string containing the
- requested identfier, or %NULL if the #GVolume
+ requested identifier, or %NULL if the #GVolume
doesn't have this kind of identifier</doc>
<type name="utf8" c:type="char*"/>
</return-value>
</method>
<method name="get_mount" c:identifier="g_volume_get_mount">
<doc xml:space="preserve">Gets the mount for the @volume.</doc>
- <return-value transfer-ownership="full">
+ <return-value transfer-ownership="full" nullable="1">
<doc xml:space="preserve">a #GMount or %NULL if @volume isn't mounted.
The returned object should be unreffed with g_object_unref()
when no longer needed.</doc>
</method>
<method name="get_sort_key" c:identifier="g_volume_get_sort_key" version="2.32">
<doc xml:space="preserve">Gets the sort key for @volume, if any.</doc>
- <return-value transfer-ownership="none">
+ <return-value transfer-ownership="none" nullable="1">
<doc xml:space="preserve">Sorting key for @volume or %NULL if no such key is available</doc>
<type name="utf8" c:type="const gchar*"/>
</return-value>
the file system UUID for the volume in question and should be
considered an opaque string. Returns %NULL if there is no UUID
available.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the UUID for @volume or %NULL if no UUID can be computed.
+ <return-value transfer-ownership="full" nullable="1">
+ <doc xml:space="preserve">the UUID for @volume or %NULL if no UUID
+ can be computed.
The returned string should be freed with g_free()
when no longer needed.</doc>
<type name="utf8" c:type="char*"/>
</field>
<field name="get_uuid">
<callback name="get_uuid">
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the UUID for @volume or %NULL if no UUID can be computed.
+ <return-value transfer-ownership="full" nullable="1">
+ <doc xml:space="preserve">the UUID for @volume or %NULL if no UUID
+ can be computed.
The returned string should be freed with g_free()
when no longer needed.</doc>
<type name="utf8" c:type="char*"/>
</field>
<field name="get_drive">
<callback name="get_drive">
- <return-value transfer-ownership="full">
+ <return-value transfer-ownership="full" nullable="1">
<doc xml:space="preserve">a #GDrive or %NULL if @volume is not
associated with a drive. The returned object should be unreffed
with g_object_unref() when no longer needed.</doc>
</field>
<field name="get_mount">
<callback name="get_mount">
- <return-value transfer-ownership="full">
+ <return-value transfer-ownership="full" nullable="1">
<doc xml:space="preserve">a #GMount or %NULL if @volume isn't mounted.
The returned object should be unreffed with g_object_unref()
when no longer needed.</doc>
</field>
<field name="get_identifier">
<callback name="get_identifier">
- <return-value transfer-ownership="full">
+ <return-value transfer-ownership="full" nullable="1">
<doc xml:space="preserve">a newly allocated string containing the
- requested identfier, or %NULL if the #GVolume
+ requested identifier, or %NULL if the #GVolume
doesn't have this kind of identifier</doc>
<type name="utf8" c:type="char*"/>
</return-value>
</field>
<field name="get_sort_key">
<callback name="get_sort_key">
- <return-value transfer-ownership="none">
+ <return-value transfer-ownership="none" nullable="1">
<doc xml:space="preserve">Sorting key for @volume or %NULL if no such key is available</doc>
<type name="utf8" c:type="const gchar*"/>
</return-value>
also listen for the "removed" signal on the returned object
and give up its reference when handling that signal
-Similary, if implementing g_volume_monitor_adopt_orphan_mount(),
+Similarly, if implementing g_volume_monitor_adopt_orphan_mount(),
the implementor must take a reference to @mount and return it in
its g_volume_get_mount() implemented. Also, the implementor must
listen for the "unmounted" signal on @mount and give up its
<function name="content_type_get_mime_type" c:identifier="g_content_type_get_mime_type">
<doc xml:space="preserve">Gets the mime type for the content type, if one is registered.</doc>
<return-value transfer-ownership="full" nullable="1">
- <doc xml:space="preserve">the registered mime type for the given @type,
- or %NULL if unknown.</doc>
+ <doc xml:space="preserve">the registered mime type for the
+ given @type, or %NULL if unknown; free with g_free().</doc>
<type name="utf8" c:type="gchar*"/>
</return-value>
<parameters>
</parameter>
<parameter name="data" transfer-ownership="none" nullable="1" allow-none="1">
<doc xml:space="preserve">a stream of data, or %NULL</doc>
- <array length="2" zero-terminated="0" c:type="guchar*">
+ <array length="2" zero-terminated="0" c:type="const guchar*">
<type name="guint8" c:type="guchar"/>
</array>
</parameter>
</parameter>
<parameter name="entries" transfer-ownership="none">
<doc xml:space="preserve">A pointer to @num_entries #GDBusErrorEntry struct items.</doc>
- <array length="3" zero-terminated="0" c:type="GDBusErrorEntry*">
+ <array length="3" zero-terminated="0" c:type="const GDBusErrorEntry*">
<type name="DBusErrorEntry" c:type="GDBusErrorEntry"/>
</array>
</parameter>
you to query it for data.
If you want to use this resource in the global resource namespace you need
-to register it with g_resources_register().</doc>
+to register it with g_resources_register().
+
+If @filename is empty or the data in it is corrupt,
+%G_RESOURCE_ERROR_INTERNAL will be returned. If @filename doesn’t exist, or
+there is an error in reading it, an error from g_mapped_file_new() will be
+returned.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">a new #GResource, or %NULL on error</doc>
<type name="Resource" c:type="GResource*"/>
</parameter>
</parameters>
</function>
+ <function name="unix_mount_get_options" c:identifier="g_unix_mount_get_options" version="2.58">
+ <doc xml:space="preserve">Gets a comma-separated list of mount options for the unix mount. For example,
+`rw,relatime,seclabel,data=ordered`.
+
+This is similar to g_unix_mount_point_get_options(), but it takes
+a #GUnixMountEntry as an argument.</doc>
+ <return-value transfer-ownership="none" nullable="1">
+ <doc xml:space="preserve">a string containing the options, or %NULL if not
+available.</doc>
+ <type name="utf8" c:type="const char*"/>
+ </return-value>
+ <parameters>
+ <parameter name="mount_entry" transfer-ownership="none">
+ <doc xml:space="preserve">a #GUnixMountEntry.</doc>
+ <type name="UnixMountEntry" c:type="GUnixMountEntry*"/>
+ </parameter>
+ </parameters>
+ </function>
<function name="unix_mount_guess_can_eject" c:identifier="g_unix_mount_guess_can_eject">
<doc xml:space="preserve">Guesses whether a Unix mount can be ejected.</doc>
<return-value transfer-ownership="none">